Compare commits

...

279 Commits

Author SHA1 Message Date
Dean Camera a854652992 Commit for the 170418 release. 2017-04-18 21:03:45 +10:00
Dean Camera 0b9b632926 Minor documentation improvements. 2017-04-18 20:34:20 +10:00
Dean Camera 4ad929f19d Update copyrights for 2017. 2017-04-18 20:30:29 +10:00
Dean Camera f0c5dfe8b8 Restrict HID bootloader programming region (thanks to NicoHood). 2017-01-29 15:36:02 +11:00
Dean Camera 0b95817130 Revert incorrect Mass Storage bootloader app start address. 2017-01-29 14:54:13 +11:00
Dean Camera f92cc29e3a Minor documentation improvements. 2017-01-25 22:23:15 +11:00
Dean Camera da5ca91756 Merge pull request #94 from eltang/descriptor_fix
Fix invalid value in HID_DESCRIPTOR_KEYBOARD() (thanks to Eric Tang).
2017-01-25 22:22:34 +11:00
Eric Tang d1862656bb Fix HID_DESCRIPTOR_KEYBOARD()
This will prevent future occurrences of jackhumbert/qmk_firmware#312.
2017-01-24 21:28:02 -08:00
Dean Camera fd50862e4e Fix incorrect reference in ASF manifest file. 2017-01-23 21:15:50 +11:00
Dean Camera 39aa928de1 Use folder-relative output folder in the XPLAINBridge makefile. 2016-10-04 21:29:43 +11:00
Dean Camera 75f367897d Minor documentation improvements. 2016-09-28 18:42:38 +10:00
Dean Camera 477326edc6 Merge pull request #89 from e-chip/master
Fix incorrect serialization in USB_SetHIDReportItemInfo() function (thanks to e-chip).
2016-09-28 18:39:55 +10:00
e-chip 66db760a33 Fix USB_SetHIDReportItemInfo() function.
Bits applying loop worked incorrect on large reports. Seems to me like a
copy/paste problem from USB_GetHIDReportItemInfo().
2016-09-28 14:12:33 +06:00
Dean Camera def392aca0 Update to latest DMBS, fix XPLAINBridge project compilation errors on full tree build. 2016-07-17 17:30:55 +10:00
Dean Camera 0f470dc8b4 Fix outdated URL in the HID bootloader Python host app documentation. 2016-04-30 15:02:40 +10:00
Dean Camera fe1c241ff7 Merge pull request #84 from eltang/eeprom_wear_fix
Update functions used to write to EEPROM (thanks to Eric Tang).
2016-04-20 19:33:20 +10:00
Eric Tang 738ded0f02 Update functions used to write to EEPROM 2016-04-19 22:28:40 -07:00
Dean Camera 7e97be22a3 Fix HID bootloader responding incorrectly to some descriptor requests (thanks to NicoHood). 2016-04-10 11:12:26 +10:00
Dean Camera 49148fef9b Replace the LUFA build system with DMBS.
Replace LUFA build system with its successor, DMBS, for easier maintenance.
2016-04-05 21:19:29 +10:00
Dean Camera 3126cbbf96 Update to DMBS release-20160403 release. 2016-04-05 21:10:07 +10:00
Dean Camera 75b68126d0 Add missing BOARD_POLOLUMICRO definition. 2016-04-03 17:26:37 +10:00
Dean Camera e3ff551659 Don't run the AVRISP-MKII Windows Driver through Doxygen. 2016-04-03 15:38:03 +10:00
Dean Camera 0ecd09c3e1 Add LUFA DMBS extension modules, use DMBS in project makefiles. 2016-04-03 15:24:34 +10:00
Dean Camera 51d3adfe18 Update to latest version of DMBS. 2016-04-03 13:52:00 +10:00
Dean Camera 3069b7d9d2 Update to latest DMBS version. 2016-04-03 11:35:25 +10:00
Dean Camera 9cca7a594f Merge branch 'master' into dmbs 2016-04-03 11:34:34 +10:00
Dean Camera 9669a00c34 Added new LUFA_VERSION_RELEASE_TYPE macro to the library version header, to determine release type (thanks to NicoHood). 2016-03-28 14:11:03 +11:00
Dean Camera 0c9856f405 Fixed invalid endpoint indexes causing memory corruption in device Clear/Set Feature standard requests (thanks to Peter Popovec). 2016-03-28 13:41:25 +11:00
Dean Camera df16148a02 Only indicate when the left mouse button is pressed in the MouseHostWithParser host demo. 2016-03-14 20:37:49 +11:00
Dean Camera f7cdc82369 Added AVRDUDE_MEMORY option to the AVRDUDE build system module (thanks to Alex Ferm). 2016-02-07 16:15:29 +11:00
Dean Camera f52566d6db Minor documentation improvements. 2016-02-07 15:46:20 +11:00
Dean Camera 1d2369e9be Remove legacy AVRISP-MKII clone compatibility compile options. 2016-02-07 15:42:39 +11:00
Dean Camera cfe2b9eff1 Oops: add missing Pololu Micro board drivers. 2016-02-07 14:53:40 +11:00
Dean Camera 6b0c46af6e Add signed Atmel Studio libUSB driver for the AVR-ISP MKII Clone. 2016-02-07 14:52:50 +11:00
Dean Camera 1e05d46b66 Update copyrights to 2016. 2016-01-31 16:11:09 +11:00
Dean Camera 78478be260 Added support for the Pololu A-Star Micro board (thanks to Joh Schneider). 2016-01-31 16:03:12 +11:00
Dean Camera 0afb548b51 Minor documentation improvements. 2016-01-27 20:31:52 +11:00
Dean Camera 9864c02eb4 Minor documentation improvements. 2016-01-27 20:31:11 +11:00
Dean Camera 25b2027544 Merge branch 'master' into dmbs 2016-01-02 17:22:18 +11:00
Dean Camera a86b502294 Fix additional void pointer arithmetic in the class driver RNDIS demo. 2015-12-22 22:36:23 +11:00
Dean Camera d0161e0a9b Fixed low level RNDIS demo incorrectly setting the RNDIS state when a null packet filter was requested. 2015-12-22 22:34:50 +11:00
Dean Camera dfdf4de8fa Fix void pointer arithmetic in the low level RNDIS demo. 2015-12-22 22:32:24 +11:00
Dean Camera 0b69eeaf5d Fix void pointer arithmetic in the Serial peripheral drivers. 2015-12-22 22:31:54 +11:00
Dean Camera 59b9cf8d0f Update changelog. 2015-12-22 22:29:27 +11:00
Dean Camera dd09a833d9 Fix additional missing va_end() in the HID bootloader CLI utility. 2015-12-22 22:28:09 +11:00
Dean Camera 593dd3dd55 Fix HID bootloader CLI app missing va_end() calls. 2015-12-22 22:20:54 +11:00
Dean Camera 2fcd50ada8 Fix C++ builds, XPLAINBridge project. 2015-12-22 22:14:09 +11:00
Dean Camera 09b6c80555 Add DMBS; don't Submodule so that people can download complete ZIP/TAR archives. 2015-12-22 21:22:11 +11:00
Dean Camera b590350df0 Clean up core build system DMBS subclass module. 2015-12-22 21:17:19 +11:00
Dean Camera e952f681db Use different jump key than the bootloaders in the documentation. 2015-12-22 20:57:36 +11:00
Dean Camera 231658362e Replace LUFA build system with DMBS. 2015-12-15 22:23:08 +11:00
Dean Camera 40e1caa2da Fixed broken USE_RAM_DESCRIPTORS compile time option when the FIXED_NUM_CONFIGURATIONS compile time option is not enabled (thanks to Matlo). 2015-12-15 21:49:05 +11:00
Dean Camera 92e9cb71e2 Fixed incorrect CALLBACK_USB_GetDescriptor() wIndex parameter type (thanks to matlo). 2015-12-02 18:56:52 +11:00
Dean Camera f42a4f3a47 Update documentation and reset version information post-release. 2015-11-15 17:07:10 +11:00
Dean Camera 9ec72190b9 Commit for the 151115 public release. 2015-11-15 14:13:03 +11:00
Dean Camera 400d3581ca Fix up broken module build tests. 2015-11-15 13:22:44 +11:00
Dean Camera b95848ab36 Update Atmel Studio integration binary, to fix broken first-run detection. 2015-11-14 17:33:02 +11:00
Dean Camera 3642ea0b97 Update Studio Integration DLL, to include package logging. 2015-11-09 19:12:14 +11:00
Dean Camera 6b06bc6237 Fixed missing bounds checks and off-by-one in the DFU bootloader signature bytes (thanks to Reuti) 2015-11-08 14:50:24 +11:00
Dean Camera 4afebc8b70 Update dfu-programmer command line arguments, old argument names have been changed in newer releases. 2015-11-08 14:20:50 +11:00
Dean Camera c9db3f0aa9 Fix AS7 integration, include modified Docbook HV1 transforms. 2015-11-01 21:28:00 +11:00
Dean Camera f2af532481 Fix local help content not visible in Atmel Studio 7 (thanks to Morten Olsen). 2015-10-25 15:50:14 +11:00
Dean Camera 903fa4a500 Fix F1 help resolution from inside Atmel Studio 7 (thanks to Morten Olsen). 2015-10-25 14:11:54 +11:00
Dean Camera 8a483fde0b Update to AS7 integration binary with corrected ASF version detection. 2015-10-06 21:22:00 +11:00
Dean Camera 13c2d91d27 Atmel Studio 7 has a newer AVRISP-MKII firmware payload. 2015-10-04 22:11:28 +11:00
Dean Camera f381d71d72 Fix dialog typo in the AS7 integration DLL. 2015-10-03 22:47:11 +10:00
Dean Camera 07e521db92 Newer AS7 integration binary, with ASF detection fixes and newer image assets. 2015-10-03 22:36:32 +10:00
Dean Camera 1914573cd4 Whitespace fixes. 2015-10-03 22:29:10 +10:00
Dean Camera 8f33ba8237 Merge pull request #46 from NicoHood/patch-1
Update Arduino Uno board definitions (thanks to NicoHood).
2015-10-03 22:12:56 +10:00
Dean Camera 5d674dddfa Fix Atmel Studio projects not enabling linker relaxations correctly. 2015-10-03 22:09:40 +10:00
Dean Camera 7a32e96f2b Minor documentation improvements. 2015-10-03 22:09:09 +10:00
Dean Camera b061f8d241 Update ye-olde copyrights on Atmel Studio integration files. 2015-10-03 10:20:32 +10:00
Dean Camera 9ef4196863 I'm getting old. Sadface. 2015-10-02 13:56:47 +10:00
Dean Camera 2fa6cbdb10 Update for (in-progress) Atmel Studio 7 support, via new integration DLL and help content fixes. 2015-10-02 11:50:02 +10:00
Dean Camera 815a29c7b2 Minor documentation improvements. 2015-09-30 21:51:27 +10:00
Dean Camera b0c64393c7 Merge pull request #62 from the2masters/RNDIS-DHCP
Add DHCP Lease Time to RNDIS Demo (thanks to Stefan Hellermann).
2015-09-30 21:49:13 +10:00
Dean Camera a9f34b5803 Merge pull request #61 from the2masters/always_inline
Add ATTR_ALWAYS_INLINE to Endianess helper functions to optimize generated code (thanks to Stefan Hellermann).
2015-09-30 21:48:36 +10:00
Stefan Hellermann 43d993e1f6 Add ATTR_ALWAYS_INLINE to Endianess helper functions to optimize generated code
Saves 68 Byte on RNDIS LowLevel Demo
Saves 48 Byte on RNDIS ClassDriver Demo
2015-09-30 10:20:35 +02:00
Stefan Hellermann 55adec1f4f Add DHCP Lease Time to RNDIS Demo
The RNDIS ClassDriver and LowLevel Demo won't work on some Linux
hosts as their DHCP client requires the DHCP Option Lease Time.
Add it to both Demos. Tested on Fedora Linux 22.
2015-09-30 09:59:19 +02:00
Dean Camera 7638128d47 Use 16-bit length for TWI driver packet read/write requests for longer transfers. 2015-09-27 16:08:13 +10:00
Dean Camera 23ada65625 Fixed incorrect comments in DataflashManager.c (thanks to Andrew Milkovich). 2015-09-27 15:47:35 +10:00
Dean Camera 56ef2b192c Minor documentation improvements. 2015-08-30 15:36:03 +10:00
Dean Camera e10b5ffe94 Fixed incorrect signature reported in the CDC/DFU bootloaders for the AT90USB82 (thanks to NicoHood). 2015-08-30 15:34:46 +10:00
Dean Camera 0626ac1f63 Add PROGMEM variant data send functions to the CDC host class driver. 2015-08-01 11:58:30 +10:00
Dean Camera 7c9c3d15e0 Minor documentation improvements. 2015-08-01 11:52:23 +10:00
Dean Camera 617763ae20 Merge pull request #49 from the2masters/progmem
Add PROGMEM string/data send variants to the CDC class driver (thanks to Stefan Hellermann).
2015-08-01 11:46:05 +10:00
Dean Camera d30294936d Merge pull request #57 from reillyeon/master
Fix compilation failure in DualVirtualSerial.c (thanks to Reilly Grant).
2015-08-01 11:43:59 +10:00
Reilly Grant a52ca7007d Fix compilation failure in DualVirtualSerial.c.
A comment on line 236 needed an extra forward slash.
2015-07-31 14:01:53 -07:00
Dean Camera ed20c250af Sourceforge is the devil. 2015-05-20 17:45:48 +10:00
Dean Camera 8fb0b4905a Add conflict warning to the AVRISP-MKII Clone project. 2015-05-20 17:20:27 +10:00
Dean Camera 1d2680b358 Update copyrights to 2015 (better late than never). 2015-05-17 13:14:29 +10:00
Dean Camera 366a846156 Fix incorrect XMEGA serial driver stream functions (thanks to William Patterson). 2015-05-17 13:01:13 +10:00
Dean Camera a9364a866f Patch HID bootloader host app to fix Windows compilation (thanks to Duncan McDonald). 2015-05-11 19:44:23 +10:00
Dean Camera 9efce7263c Don't fail Doxygen on versions built without various features. 2015-04-26 13:01:32 +10:00
Dean Camera faf41c4445 Add CDC control line state change handlers to the class driver demos, to demonstrate how to read DTR change events. 2015-03-15 20:12:59 +11:00
Dean Camera be2df78637 Minor documentation improvements. 2015-03-15 19:51:15 +11:00
Dean Camera 4dbe0176ba Minor documentation improvements. 2015-03-15 19:36:09 +11:00
Dean Camera 4d31a05d62 Merge pull request #50 from the2masters/gitignore
Add compiled HID bootloader CLI binary to .gitignore.
2015-03-10 23:24:02 +11:00
Dean Camera bf3a95d5a7 Merge pull request #47 from NicoHood/patch-2
Add a clean up delay in the CDC bootloader before disconnect to fix transient communication issues (thanks to NicoHood).
2015-03-10 23:23:11 +11:00
Dean Camera 05fe6ab871 Merge branch 'master' of github.com:abcminiuser/lufa 2015-03-10 23:24:47 +11:00
Dean Camera b504397d94 Documentation fixes. 2015-03-10 23:24:35 +11:00
Stefan Hellermann 599c84ef26 ignore HID Bootloader upload tool 2015-02-28 12:30:32 +01:00
Stefan Hellermann 64ef5396a5 Add Progmem Variant to CDC_Device_Send 2015-02-28 12:30:04 +01:00
Dean Camera 4185d21fcd Merge pull request #48 from BrianAdams/patch-1
Fixed typo in micro board definition in Studio (thanks to Brian Adams).
2015-02-27 10:34:11 +11:00
badevguru fd39bcf72b Fixed typo in micro board definition in Studio
System was displaying two yun boards in the drop down in ASF Wizard
2015-02-26 15:11:48 -08:00
Nico e3988f19dd Update BootloaderCDC.c 2015-02-24 13:31:32 +01:00
Nico 017d0d8f91 Update Board.h
Added reset lines
2015-02-24 09:42:31 +01:00
Nico 6e5df9e4be Update LEDs.h
Changed Led 5 and 4 to be compatible with the official firmware:
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial/Board/LEDs.h#L54-L57

Added TX and RX Led makro

Fixed wrong Led logic: OUT and LOW results in LED on.
2015-02-24 09:38:12 +01:00
Dean Camera 31f4260705 Update documentation. 2015-02-12 19:20:09 +11:00
Dean Camera 0c3cc14006 Upgrade to latest Doxygen. 2014-12-27 10:23:41 +11:00
Dean Camera e37e86583c Add board drivers for the Atmel Xplained-MINI kits. 2014-11-20 14:45:20 +11:00
Dean Camera 99ca3aff38 Use XPLAIN board by default in the XPLAINBridge project inside Atmel Studio. 2014-11-16 16:39:12 +11:00
Dean Camera 250feb29cf Minor documentation improvements to the Mass Storage bootloader. 2014-10-12 22:37:11 +11:00
Dean Camera 2358d7dcac Revert "Improve bootloader documentation."
Revert commit 2304a73050 as it breaks
compilation of the bootloaders.
2014-10-12 22:19:16 +11:00
Dean Camera 2304a73050 Improve bootloader documentation. 2014-10-12 16:58:42 +11:00
Dean Camera a09cb7e3d8 Fix bootloaders not starting user application if the HWB is grounded during watchdog reset. 2014-10-12 16:43:30 +11:00
Dean Camera 4c637c93ba Add Leonardo compatibility to most bootloaders, run user application if BOOTRST fuse is set and the last reset cause was not the /RESET pin. 2014-10-11 16:43:41 +11:00
Dean Camera fef991e28b The ATPROGRAM LUFA build system module now defaults to the Atmel ICE debuger tool, instead of the Atmel JTAG ICE3. 2014-10-11 15:42:16 +11:00
Dean Camera df366e055d Don't run user application in the bootloader unless a valid app is present (thanks to Alex Kazik). 2014-10-11 15:15:02 +11:00
Dean Camera 17158b359f Update documentation post-140928 release. 2014-09-28 16:12:09 +10:00
Dean Camera def7fca736 Add missing MICRO board drivers. 2014-09-28 15:48:15 +10:00
Dean Camera f2993bd6de Update documentation for the 140928 release. 2014-09-28 15:30:18 +10:00
Dean Camera 2d00107efe Fixed broken LowLevel Audio Out demo sampling frequency configuration (thanks to Torsten Duwe). 2014-09-28 15:06:31 +10:00
Dean Camera 77829096ad Minor documentation improvements. 2014-09-21 17:22:36 +10:00
Dean Camera 5df2027e79 Minor documentation improvements. 2014-09-14 16:52:36 +10:00
Dean Camera 41634c4530 Obsolete the old MACROS and MACROE convenience macros. 2014-09-14 11:45:02 +10:00
Dean Camera 6c8ebd70c7 Fixed broken AVR8 USART-SPI peripheral driver (thanks to Phil Zakielarz). 2014-09-13 16:29:29 +10:00
Dean Camera 025e57bd72 Minor documentation improvements. 2014-09-11 23:33:55 +10:00
Dean Camera 70f7e6558c Add Atmel Studio support for the Arduino Yun and Micro boards. 2014-09-11 23:22:00 +10:00
Dean Camera c69a623652 Add support for the Arduino Micro board, fix other Arduino board LED drivers. 2014-09-11 23:16:16 +10:00
Dean Camera 5e4b14f007 Oops - include board and LED drivers for the Arduino Yun. 2014-09-11 22:24:16 +10:00
Dean Camera 7046ebb37b Add board support for the Arduino YUN ATMEGA32U4 coprocessor. 2014-09-11 22:22:22 +10:00
Dean Camera 7dc746c2c1 Minor documentation improvements. 2014-09-11 19:57:23 +10:00
Dean Camera b62c68810d Minor documentation improvements. 2014-09-08 21:10:20 +10:00
Dean Camera 7423c1213f Merge pull request #36 from hexwab/midimacrofix
Add missing argument parenthesis on the MIDI_EVENT() macro.
2014-09-08 21:04:31 +10:00
Dean Camera 3692325f58 Merge pull request #38 from jacobschloss/xmega_twi_caps
Fix mismatched capitalization of "TWI" for the XMEGA architecture TWI driver.
2014-09-08 21:03:38 +10:00
Jacob Schloss b73cec0876 Make twi capitalization match. 2014-09-07 18:44:34 -07:00
Tom Hargreaves b1603ba06e add parens around args in MIDI_EVENT macro 2014-09-06 04:53:36 +01:00
Dean Camera 2f4b2e6f34 Oops: fix incorrect filename in the Dual MIDI device demo. 2014-08-31 21:33:20 +10:00
Dean Camera 4d8ff75993 Add Dual MIDI device class driver demo application. 2014-08-31 21:27:35 +10:00
Dean Camera 0091b3c819 Minor documentation improvements. 2014-08-31 20:46:43 +10:00
Dean Camera 5f75c592e0 Minor documentation improvements. 2014-08-31 20:40:53 +10:00
Dean Camera 0e68abcd4f Fix overflow for RNDIS class driver responses when returning the adapter query list (thanks to Peter Mc Shane). 2014-08-31 20:14:48 +10:00
Dean Camera 2db71bc8a4 Minor documentation improvements. 2014-08-31 16:58:15 +10:00
Dean Camera d0a147f5bb Patched the LUFA build system to work around a GCC code generation bug in newer toolchains when building for larger FLASH memory devices (thanks to demultiplexer) 2014-08-26 21:18:59 +10:00
Dean Camera 0fd7b2cf09 Merge branch 'master' of github.com:abcminiuser/lufa 2014-08-24 18:57:20 +10:00
Dean Camera 0ae0b1995f Remove correct output library file when running make clean in the LUFA build system. 2014-08-24 18:56:56 +10:00
Dean Camera a52dc06e62 Update Doxygen confiuration files to 1.8.8. 2014-08-24 18:54:39 +10:00
Dean Camera 4cc04eec01 Merge pull request #35 from hellprototypes/sandbox
Fix Serial_XMEGA.h typos.
2014-08-13 20:30:46 +10:00
Hell f6fe9db8ba Fix Serial_XMEGA.h syntax and define error 2014-08-13 17:55:05 +08:00
Dean Camera b6899bb987 Fixed USART reception overrun corrupting the internal buffers in the USBtoSerial project. 2014-08-10 19:17:58 +10:00
Dean Camera 4c06a9c88f Minor code style fixes, documentation improvements. 2014-07-22 19:25:41 +10:00
Dean Camera 89df1efcf3 Merge pull request #32 from The-42/fix-xmega-usb-prescaler
Fix XMEGA USB prescaler calculation (thanks to Bert van Hall).
2014-07-22 19:08:25 +10:00
Bert van Hall c499a0b755 Fix XMEGA USB prescaler calculation
The USB prescaler calculation for the CLK.USBCTRL register is changed to
give valid results and set the prescaler correctly.

Signed-off-by: Bert van Hall <bert.vanhall@avionic-design.de>
2014-07-22 10:41:55 +02:00
Dean Camera 526091fba4 Minor documentation improvements. 2014-07-16 20:08:46 +10:00
Dean Camera 0c15a45128 Update bootloader documentation to include execution instructions. 2014-07-15 22:02:19 +10:00
Dean Camera d90ef9aa2f Only deque from the USBtoSerial's USB->USART buffer when the USART is idle. 2014-07-15 21:23:51 +10:00
Dean Camera 3d818fbb86 Add Serial_IsSendReady() and Serial_IsSendComplete() serial driver API functions. 2014-07-15 21:23:13 +10:00
Dean Camera 0c00c2aaa3 Update documentation for HID report ID fix. 2014-06-25 20:57:43 +10:00
Dean Camera 2812287488 Merge pull request #28 from The-42/fix-feature-id
Fix missing report IDs for HID device class GetReport request responses (thanks to Bert van Hall).
2014-06-25 20:54:04 +10:00
Bert van Hall ffb5f7e3b3 Fix missing report IDs in feature reports
As it is the case for input reports, the ID has to be sent for feature
reports when a device has multiple reports implemented.

Signed-off-by: Bert van Hall <bert.vanhall@avionic-design.de>
2014-06-19 14:38:49 +02:00
Dean Camera b8f7dae24c Fix possible infinite loop in the control stream write template functions. 2014-06-08 15:33:29 +10:00
Dean Camera 910c6eb599 Add COMPILER_PATH optional variable to the BUILD build system module. 2014-06-08 15:29:08 +10:00
Dean Camera 22b3970338 Ensure BulkVendor received data is cleared before reading from host. 2014-06-07 17:25:10 +10:00
Dean Camera 1b93c85b20 Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen). 2014-05-30 19:48:19 +10:00
Dean Camera f63496a117 Fix AVRISP-MKII status values to match the published protocol (thanks to Gustavo Souza). 2014-05-27 21:38:46 +10:00
Dean Camera c4e85215bf Fixed incorrect XMEGA DFLL reference frequency (thanks to Martin Aakerberg) 2014-05-21 19:55:27 +10:00
Dean Camera 7768935889 Fix LED driver for the Arduino Leonardo board. 2014-04-30 20:36:49 +10:00
Dean Camera 7ad97a3d5d Merge branch 'master' of github.com:abcminiuser/lufa 2014-04-21 22:38:39 +10:00
Dean Camera 57ef7a79b4 Upgrade to latest Doxygen. 2014-04-21 22:38:20 +10:00
Dean Camera 45f0971da5 Merge pull request #23 from mondalaci/add-further-scancodes
Fix typos and add new macros for HID keyboard scancodes.
2014-04-07 13:44:53 +02:00
László Monda c0e32775f3 Fix typos and add new macros for HID keyboard scancodes. 2014-04-06 19:27:40 +02:00
Dean Camera a532f2ad1b Update to latest Atmel Studio integration binary, improve Getting Started page in the manual. 2014-03-31 22:29:42 +11:00
Dean Camera d8f36aa7a8 More fixes for incorrect return types/values. 2014-03-09 15:38:27 +11:00
Dean Camera 261284f5e1 Fix incorrect error codes returned on pip config failure in the host class drivers. 2014-03-05 21:41:45 +11:00
Dean Camera 00ddff45c1 Revert version and update documentation after the 140302 release. 2014-03-01 21:30:40 +11:00
Dean Camera b6c18b2a7c Update version for the 140302 release. 2014-03-01 21:27:08 +11:00
Dean Camera a80d0c9965 Add Atmel Studio 6.2 compatibility. 2014-03-01 21:09:00 +11:00
Dean Camera fa32989f2e Minor typo corrections. 2014-02-22 17:11:21 +11:00
Dean Camera aaef4fa84c Merge branch 'master' of github.com:abcminiuser/lufa 2014-02-16 17:21:54 +11:00
Dean Camera 9dc7e68d76 Fix incorrect whitespace. 2014-02-16 17:21:37 +11:00
Dean Camera 2141155e9e Update to latest Atmel Studio integration binary. 2014-02-16 17:21:14 +11:00
Dean Camera c49d4af449 Merge pull request #21 from mondalaci/fix-ringbuffer-example
Fix ring buffer example.
2014-02-01 14:30:29 -08:00
László Monda 987cd32f65 Fix ring buffer example. 2014-02-01 20:48:33 +01:00
Dean Camera b095177e20 Fix incorrect descriptor length when using USB_STRING_DESCRIPTOR macros. 2014-01-27 22:28:53 +11:00
Dean Camera c5282637ed Fix documentation: jump address for bootloader should be words, not bytes. 2014-01-13 10:06:27 +11:00
Dean Camera 0d84b65f0b Rename all Doxygen.conf file to doxyfile and distribute them in the Atmel Studio extension. 2014-01-08 21:47:59 +11:00
Dean Camera 5789767889 Fix USB_STRING_DESCRIPTOR() macro reported length to account for the null-terminator. 2014-01-08 10:51:48 +11:00
Dean Camera 32c5c43bf0 Minor documentation improvements. 2014-01-08 10:42:06 +11:00
Dean Camera 8328175482 Add USB_STRING_DESCRIPTOR_ARRAY() macro, update demos where required. 2014-01-08 10:41:16 +11:00
László Monda deb1675f84 Use the new USB_STRING_DESCRIPTOR macro for every string descriptor. 2014-01-08 10:36:19 +11:00
László Monda 28cadf077e Add USB_STRING_DESCRIPTOR and make the Keyboard demo use it. 2014-01-08 10:36:18 +11:00
Dean Camera 2e70de6194 Update to latest Atmel Studio integration binary. 2014-01-07 15:20:04 +11:00
Dean Camera 812114d9c1 Fix broken teensy-ee build rule. 2014-01-07 15:19:53 +11:00
Dean Camera 129824028b Update to latest Atmel Studio integration binary. 2014-01-06 14:52:49 +11:00
Dean Camera 92006938d3 Minor documentation improvements. 2014-01-06 11:38:47 +11:00
Dean Camera 0f6c155a04 Minor documentation improvements. 2014-01-05 11:38:59 +11:00
Dean Camera 161263af47 Merge pull request #19 from mondalaci/attr-no-inline-cleanup
Get rid of the redundant ATTR_NEVER_INLINE macro which translated to the...
2014-01-04 16:31:49 -08:00
László Monda 5cae541545 Get rid of the redundant ATTR_NEVER_INLINE macro which translated to the same as ATTR_NO_INLINE. 2014-01-05 00:33:08 +01:00
Dean Camera e368a89987 Update copyrights for 2014. 2014-01-04 10:45:02 +11:00
Dean Camera 510d29d472 Minor documentation improvements. 2014-01-04 09:56:09 +11:00
Dean Camera ef16683b42 Merge pull request #17 from mondalaci/further-generichid-modemmanager-instructions
Add further instructions regarding the modemmanager suckage.
2014-01-03 14:47:00 -08:00
László Monda 6e0baf4342 Add further instructions regarding the modemmanager suckage. 2014-01-03 23:44:26 +01:00
Dean Camera ccbba9bfe5 Minor documentation improvements. 2013-12-30 17:09:52 +11:00
Dean Camera 92d1d0342b Update VSIX extension manifest description. 2013-12-30 12:39:59 +11:00
Dean Camera 123b5bc47b Minor documentation improvements. 2013-12-27 00:53:12 +11:00
Dean Camera 4c25f212c3 Upgrade Doxygen configuration files to the latest version. 2013-12-26 15:09:58 +11:00
Dean Camera af893c3df6 Update to latest LUFA Atmel Studio integration binary. 2013-12-22 13:40:10 +11:00
Dean Camera 31022dfbe9 Fix incorrect Dataflash header file included for the STK525 inside Atmel Studio. 2013-12-20 20:36:19 +11:00
Dean Camera 1cd0f66347 Merge pull request #15 from mondalaci/limit-control-transfer-size
Add todo item.
2013-12-20 01:18:34 -08:00
Dean Camera d8f0d2709b Minor documentation improvements. 2013-12-20 20:19:33 +11:00
Dean Camera 9965b2ca0a Merge pull request #16 from hansmi/master
AVR8: Add option to keep 3.3V regulator enabled.
2013-12-20 01:11:45 -08:00
Michael Hanselmann 25a02432e7 AVR8: Add option to keep 3.3V regulator enabled
The documentation contains example code[1] on how to restart into the
bootloader. In the process of preparing for the reset, USB is disabled
using “USB_Disable()”. For hardware making use of the AVR8's internal
3.3V regulator that call would also disable the regulator, resetting the
processor immediately rather than setting the boot key and letting the
watchdog reset the processor.

This patch adds a new flag to be given to “USB_Init()” or to be defined
in “USE_STATIC_OPTIONS” telling “USB_Disable()” to keep the regulator
enabled.

On November 1st, 2013 this issue was already mentioned on the mailing
list[2], but no fix came from that discussion.

[1]
<http://www.fourwalledcubicle.com/files/LUFA/Doc/130901/
html/_page__software_bootloader_start.html>

[2]
<https://groups.google.com/d/msg/lufa-support/uwrFpRQpJzU/e9I6UK5jMJQJ>

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2013-12-20 00:04:51 +01:00
László Monda a359a266df Add todo item. 2013-12-18 18:55:47 +01:00
Dean Camera 70a726b5aa Fix STK525 and STK526 device support in the Atmel Studio extension. 2013-12-14 22:46:05 +11:00
Dean Camera e3cb0f48ef Use new VERSION_BCD() macro with explicit int arguments to fix edge cases with the previous floating point macro version. 2013-11-21 19:19:45 +01:00
Dean Camera 52c69331ec Reduce PDI/TPI reset hold period from 1ms to 100us, as the former caused sporadic session issues. 2013-11-21 18:41:17 +01:00
Dean Camera 52a5016576 Exclude all host application directories from the Doxygen configuration files. 2013-11-20 20:25:15 +01:00
Dean Camera 8edd561948 Fix incorrect status constants in the AVRISP-MKII Clone project. 2013-11-20 20:20:22 +01:00
Dean Camera 32013ebffb Add Documentation output directories to the .gitignore list. 2013-11-20 20:18:28 +01:00
Dean Camera 6eba84bf4b Fixed MIDI device class driver MIDI_Device_ReceiveEventPacket() for the XMEGA architecture. 2013-11-05 22:16:15 +01:00
Dean Camera 16c4f1d43c Increase AVRISP-MKII Clone PDI/TPI handshake to 1ms from 1us for targets with high /RESET line capacitance. 2013-11-04 17:09:21 +01:00
Dean Camera 4b6049bb59 Minor documentation improvements. 2013-11-03 22:21:50 +01:00
Dean Camera d251ef6bed Merge pull request #12 from mondalaci/generichid-node-libusb-script
Add node.js libusb GenericHID test script.
2013-11-03 13:16:28 -08:00
László Monda 9d6303cead Add node.js libusb GenericHID test script. 2013-11-03 19:13:20 +01:00
Dean Camera 90c7491e51 Minor documentation improvements. 2013-11-03 15:47:58 +01:00
Dean Camera d2eaf94dbb Merge pull request #11 from mondalaci/generichid-libusb-scripts
Add libusb GenericHID Python test script.
2013-11-03 06:41:56 -08:00
Dean Camera 6b214472b7 Fix signature bytes in the DFU class bootloader. 2013-11-03 15:44:55 +01:00
László Monda d31e0a4d37 Add libusb GenericHID Python test script. 2013-11-02 18:56:37 +01:00
Dean Camera bcd07f4f8a AVRISP-MKII Clone Project PDI/TPI frequency increased from 250KHz to 2MHz as it is now stable. 2013-11-02 12:17:31 +01:00
Dean Camera 94323fadd1 Minor documentation improvements. 2013-10-30 19:36:55 +01:00
Dean Camera b7b6f212e9 Add new Bulk Vendor device demo application. 2013-10-30 19:34:31 +01:00
Dean Camera 14e44b626f Add Python host test application for the low level GenericHID demo. 2013-10-30 18:56:02 +01:00
Dean Camera 814d0b9098 Minor documentation fixes. 2013-10-27 23:15:20 +01:00
Dean Camera 85141b37f9 Use non-abbreviated XPROG/PDI/TPI constant names. 2013-10-27 22:36:02 +01:00
Dean Camera 560e5f75fb Refactor AVRISP MKII Clone PDI/TPI command constants to simplify the driver code. 2013-10-27 21:34:44 +01:00
Dean Camera e1b19e4e10 More minor speedups to the AVRISP-MKII clone programmer PDI memory reading code. 2013-10-27 18:26:11 +01:00
Dean Camera 13b3014db4 Merge branch 'master' of github.com:abcminiuser/lufa 2013-10-27 18:25:30 +01:00
Dean Camera 3fc75f130b Minor documentation improvements. 2013-10-27 18:16:07 +01:00
Dean Camera cf41d16bc7 Only issue the REPEAT instruction in the clone programmer if needed to reduce protocol overhead. 2013-10-27 18:15:03 +01:00
Dean Camera e7a8fd6033 Merge pull request #10 from mondalaci/replace-audio-interface-numbers-with-enums
Replace remaining MIDI interface numbers with enums.
2013-10-12 02:15:50 -07:00
László Monda cb10891bd6 Replace remaining MIDI interface numbers with enums. 2013-10-12 00:44:50 +02:00
Dean Camera 7024bb4c79 Merge pull request #9 from mondalaci/replace-remaining-interface-numbers-with-enums
Replace CDC interface numbers with enums.
2013-10-11 12:50:01 -07:00
László Monda 352152c664 Replace CDC interface numbers with enums. 2013-10-10 00:32:35 +02:00
Dean Camera ab238601b9 Minor documentation corrections. 2013-10-06 22:33:32 +02:00
Dean Camera 7ce4d35c39 Merge pull request #8 from mondalaci/extract-interface-numbers
Extract interface numbers into enums.
2013-10-06 13:22:23 -07:00
László Monda 9ef29ea229 Extract interface numbers into enums. 2013-10-06 22:16:20 +02:00
Dean Camera 8e2476a125 Merge pull request #7 from mondalaci/hidclassdevice_whitespaces
Use spaces instead of tabs where necessary to fix indentation.
2013-09-27 09:48:42 -07:00
Dean Camera 8026bee8d6 Merge branch 'mondalaci-avr910_typos' 2013-09-27 18:51:41 +02:00
Dean Camera b6bf314d50 Minor formatting fixes. 2013-09-27 18:50:34 +02:00
László Monda ef1a4b750b Use spaces instead of tabs wherever necessary to fix indentation. 2013-09-24 11:19:42 +02:00
László Monda c41512c1e8 Use spaces instead of tabs where necessary to fix indentation. 2013-09-24 11:09:36 +02:00
László Monda 75419b4d97 Fix "AVR910" typos to "AVR109". 2013-09-24 02:16:04 +02:00
Dean Camera cd3aae87da Add missing AppConfig.h reference in the Mass Storage class bootloader when used in Atmel Studio. 2013-09-16 18:45:32 +02:00
Dean Camera d6be06ea6a Remove style override that conflicts with the latest MSHelp branding package from Atmel. 2013-09-05 17:55:48 +02:00
Dean Camera 716f356b21 Minor code style fix. 2013-09-05 17:44:57 +02:00
Dean Camera b229aef6f7 Reset version information following the 130901 release. 2013-09-01 14:12:29 +02:00
Dean Camera 012c565609 Version for the 130901 release. 2013-09-01 14:09:21 +02:00
Dean Camera dbad27dd6d Minor documentation improvements. 2013-09-01 13:25:43 +02:00
Dean Camera 53f7499009 Minor documentation improvements. 2013-09-01 12:05:47 +02:00
Dean Camera 96f2634770 Oops - use unique section names for the board driver stubs in the documentation. 2013-09-01 12:03:55 +02:00
Dean Camera c18283a275 Add user board driver stub code to the documentation. 2013-09-01 12:02:13 +02:00
Dean Camera 14ba7a7047 Fix outdated filename references in the LUFA documentation. 2013-09-01 11:34:38 +02:00
Dean Camera adb61c7b29 Add security warnings to the documentation of bootloaders without secure writes. 2013-09-01 11:14:28 +02:00
Dean Camera 2ba22d5571 Fix outdated Benito project ASF XML. 2013-08-31 12:57:47 +02:00
Dean Camera a8d907d704 Add DefaultInstall section to all INF driver files for easier installation. 2013-08-31 11:23:41 +02:00
Dean Camera 6216a71e1c Update Atmel Studio integration blob with better online documentation links and Getting Started graphics. 2013-08-31 00:34:20 +02:00
Dean Camera ce546b43cc Add Atmel Studio integration known issues. 2013-08-31 00:31:19 +02:00
Dean Camera af0adbcb36 Minor documentation improvements. 2013-08-25 00:36:09 +02:00
Dean Camera e5bee74fca Update Atmel Studio binary blob; update help when the extension is updated, add additional Getting Started information. 2013-08-24 16:01:40 +02:00
Dean Camera 8cd0b383c5 Fix double-spaced code samples in the Docbook transform output. 2013-08-23 23:27:09 +02:00
Dean Camera fbe2982858 Update to latest Doxygen configurations, patch Doxygen->Docbook transform due to changes in the code fragment output in the Doxygen XML. 2013-08-23 23:04:31 +02:00
Dean Camera aded8373cc Fixed error receiving PIMA events via the Still Image Host class driver. 2013-08-23 22:59:58 +02:00
Dean Camera 44bc433fb0 Fix code style in the HID parser module. 2013-08-23 21:42:51 +02:00
Dean Camera 46621b7a11 Add missing Known Issue entry for a previous LUFA release. 2013-08-19 20:23:48 +02:00
Dean Camera 41046f2354 Remove incorrect entry from the Known Issues list. 2013-08-19 20:22:29 +02:00
Dean Camera 179e18cf58 Prevent accessing past the UsageList bounds in the HID parser when dequeueing a usage. 2013-08-19 20:20:44 +02:00
Dean Camera cba09e323d Remove outdated known issue from the Known Issues list of the documentation. 2013-08-19 19:54:15 +02:00
Dean Camera 03ce1bc503 Bump AVRISP-MKII version number to be compatible with Atmel Studio 6.1 SP2. 2013-08-19 18:30:00 +02:00
1410 changed files with 206981 additions and 157545 deletions
+2
View File
@@ -9,5 +9,7 @@
*.map
*.bak
*.class
Documentation/
LUFA/StudioIntegration/ProjectGenerator/*
LUFA/StudioIntegration/DocBook/*
!LUFA/StudioIntegration/Docbook/mshelp/*
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+3 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -44,7 +44,7 @@
#include <LUFA/Common/Common.h>
#include "Config/AppConfig.h"
/* Function Prototypes: */
void BootloaderAPI_ErasePage(const uint32_t Address);
void BootloaderAPI_WritePage(const uint32_t Address);
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+47 -15
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -72,7 +72,17 @@ void Application_Jump_Check(void)
{
bool JumpToApplication = false;
#if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
#if (BOARD == BOARD_LEONARDO)
/* Enable pull-up on the IO13 pin so we can use it to select the mode */
PORTC |= (1 << 7);
Delay_MS(10);
/* If IO13 is not jumpered to ground, start the user application instead */
JumpToApplication = ((PINC & (1 << 7)) != 0);
/* Disable pull-up after the check has completed */
PORTC &= ~(1 << 7);
#elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
/* Disable JTAG debugging */
JTAG_DISABLE();
@@ -81,21 +91,41 @@ void Application_Jump_Check(void)
Delay_MS(10);
/* If the TCK pin is not jumpered to ground, start the user application instead */
JumpToApplication |= ((PINF & (1 << 4)) != 0);
JumpToApplication = ((PINF & (1 << 4)) != 0);
/* Re-enable JTAG debugging */
JTAG_ENABLE();
#else
/* Check if the device's BOOTRST fuse is set */
if (boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS) & FUSE_BOOTRST)
{
/* If the reset source was not an external reset or the key is correct, clear it and jump to the application */
if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << EXTRF);
}
else
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application;
* this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << WDRF);
}
#endif
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication |= true;
/* Don't run the user application if the reset vector is blank (no app loaded) */
bool ApplicationValid = (pgm_read_word_near(0) != 0xFFFF);
/* If a request has been made to jump to the user application, honor it */
if (JumpToApplication)
if (JumpToApplication && ApplicationValid)
{
/* Turn off the watchdog */
MCUSR &= ~(1<<WDRF);
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Clear the boot key and jump to the user application */
@@ -127,6 +157,9 @@ int main(void)
USB_USBTask();
}
/* Wait a short time to end all USB transactions and then disconnect */
_delay_us(1000);
/* Disconnect from the host - USB interface will be reset later along with the AVR */
USB_Detach();
@@ -236,9 +269,9 @@ void EVENT_USB_Device_ControlRequest(void)
#if !defined(NO_BLOCK_SUPPORT)
/** Reads or writes a block of EEPROM or FLASH memory to or from the appropriate CDC data endpoint, depending
* on the AVR910 protocol command issued.
* on the AVR109 protocol command issued.
*
* \param[in] Command Single character AVR910 protocol command indicating what memory operation to perform
* \param[in] Command Single character AVR109 protocol command indicating what memory operation to perform
*/
static void ReadWriteMemoryBlock(const uint8_t Command)
{
@@ -327,7 +360,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
else
{
/* Write the next EEPROM byte from the endpoint */
eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address counter after use */
CurrAddress += 2;
@@ -402,7 +435,7 @@ static void WriteNextResponseByte(const uint8_t Response)
Endpoint_Write_8(Response);
}
/** Task to read in AVR910 commands from the CDC data OUT endpoint, process them, perform the required actions
/** Task to read in AVR109 commands from the CDC data OUT endpoint, process them, perform the required actions
* and send the appropriate response back to the host.
*/
static void CDC_Task(void)
@@ -581,7 +614,7 @@ static void CDC_Task(void)
else if (Command == AVR109_COMMAND_WriteEEPROM)
{
/* Read the byte from the endpoint and write it to the EEPROM */
eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address after use */
CurrAddress += 2;
@@ -638,4 +671,3 @@ static void CDC_Task(void)
/* Acknowledge the command from the host */
Endpoint_ClearOUT();
}
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+29 -6
View File
@@ -54,6 +54,33 @@
* When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the
* bootloader from the normal user application.
*
* \warning <b>THIS BOOTLOADER IS NOT SECURE.</b> Malicious entities can recover written data, even if the device
* lockbits are set.
*
* \section Sec_Running Running the Bootloader
*
* On the USB AVR8 devices, setting the \c HWBE device fuse will cause the bootloader to run if the \c HWB pin of
* the AVR is grounded when the device is reset.
*
* The are two behaviours of this bootloader, depending on the device's fuses:
*
* <b>If the device's BOOTRST fuse is set</b>, the bootloader will run any time the system is reset from
* the external reset pin, unless no valid user application has been loaded. To initiate the bootloader, the
* device's external reset pin should be grounded momentarily.
*
* <b>If the device's BOOTRST fuse is not set</b>, the bootloader will run only if initiated via a software
* jump, or if the \c HWB pin was low during the last device reset (if the \c HWBE fuse is set).
*
* For board specific exceptions to the above, see below.
*
* \subsection SSec_XPLAIN Atmel Xplain Board
* Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the
* \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \subsection SSec_Leonardo Arduino Leonardo Board
* Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the
* \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \section Sec_Installation Driver Installation
*
* After running this bootloader for the first time on a new computer, you will need to supply the .INF
@@ -168,6 +195,8 @@
* this module to try to take control over inserted CDC devices, corrupting the
* datastream. A UDEV rule is required to prevent this.
* See <a href=https://groups.google.com/d/msg/lufa-support/CP9cy2bc8yo/kBqsOu-RBeMJ>here</a> for resolution steps.
* If the issue still persists then uninstall modemmanager by executing <tt>sudo apt-get remove modemmanager</tt>, or
* the equivalent using your chosen distribution's package manager.
*
* \par On Linux machines, the CDC bootloader is inaccessible.
* On many Linux systems, non-root users do not have automatic access to newly
@@ -175,12 +204,6 @@
* access.
* See <a href=https://groups.google.com/d/msg/lufa-support/CP9cy2bc8yo/kBqsOu-RBeMJ>here</a> for resolution steps.
*
* \par After loading an application, it is not run automatically on startup.
* Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. In most cases, the BOOTRST
* fuse should be disabled and the HWBE fuse used instead to run the bootloader
* when needed.
*
* \section Sec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+4 -4
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -35,7 +35,7 @@
* compile time options, as an alternative to the compile time
* constants supplied through a makefile.
*
* For information on what each token does, refer to the
* For information on what each token does, refer to the
* \ref Sec_Options section of the application documentation.
*/
@@ -47,4 +47,4 @@
// #define NO_FLASH_BYTE_SUPPORT
// #define NO_LOCK_BYTE_WRITE_SUPPORT
#endif
#endif
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+13 -28
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -46,7 +46,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.USBSpecification = VERSION_BCD(1,1,0),
.Class = CDC_CSCP_CDCClass,
.SubClass = CDC_CSCP_NoSpecificSubclass,
.Protocol = CDC_CSCP_NoSpecificProtocol,
@@ -55,7 +55,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x204A,
.ReleaseNumber = VERSION_BCD(01.00),
.ReleaseNumber = VERSION_BCD(1,0,0),
.ManufacturerStrIndex = STRING_ID_Manufacturer,
.ProductStrIndex = STRING_ID_Product,
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_CDC_CCI,
.AlternateSetting = 0,
.TotalEndpoints = 1,
@@ -107,7 +107,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
.Subtype = 0x00,
.CDCSpecification = VERSION_BCD(01.10),
.CDCSpecification = VERSION_BCD(1,1,0),
},
.CDC_Functional_ACM =
@@ -123,8 +123,8 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
.Subtype = 0x06,
.MasterInterfaceNumber = 0,
.SlaveInterfaceNumber = 1,
.MasterInterfaceNumber = INTERFACE_ID_CDC_CCI,
.SlaveInterfaceNumber = INTERFACE_ID_CDC_DCI,
},
.CDC_NotificationEndpoint =
@@ -141,7 +141,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 1,
.InterfaceNumber = INTERFACE_ID_CDC_DCI,
.AlternateSetting = 0,
.TotalEndpoints = 2,
@@ -178,34 +178,19 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
};
const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera");
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(8), .Type = DTYPE_String},
.UnicodeString = L"LUFA CDC"
};
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"LUFA CDC");
/** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
@@ -214,7 +199,7 @@ const USB_Descriptor_String_t ProductString =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
+17 -7
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -84,7 +84,7 @@
#define AVR_SIGNATURE_3 0x89
#elif defined(__AVR_AT90USB82__)
#define AVR_SIGNATURE_1 0x1E
#define AVR_SIGNATURE_2 0x94
#define AVR_SIGNATURE_2 0x93
#define AVR_SIGNATURE_3 0x82
#else
#error The selected AVR part is not currently supported by this bootloader.
@@ -127,20 +127,30 @@
USB_Descriptor_Endpoint_t CDC_DataInEndpoint;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */
INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */
};
/** Enum for the device string descriptor IDs within the device. Each string descriptor should
* have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors.
*/
enum StringDescriptors_t
{
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
};
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -3,6 +3,9 @@
; Copyright (c) 2000 Microsoft Corporation
;************************************************************
[DefaultInstall]
CopyINF="LUFA CDC Bootloader.inf"
[Version]
Signature="$Windows NT$"
Class=Ports
@@ -60,4 +63,4 @@ HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider"
;------------------------------------------------------------------------------
[Strings]
MFGNAME="http://www.lufa-lib.org"
DESCRIPTION="LUFA CDC Class Bootloader"
DESCRIPTION="LUFA CDC Class Bootloader"
+1
View File
@@ -148,6 +148,7 @@
<build type="header-file" value="Config/LUFAConfig.h"/>
<build type="header-file" value="Config/AppConfig.h"/>
<build type="distribute" subtype="user-file" value="doxyfile"/>
<build type="distribute" subtype="user-file" value="BootloaderCDC.txt"/>
<build type="distribute" subtype="user-file" value="LUFA CDC Bootloader.inf"/>
File diff suppressed because it is too large Load Diff
+16 -9
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -45,11 +45,18 @@ BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, Boot
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+80 -18
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -108,7 +108,17 @@ void Application_Jump_Check(void)
{
bool JumpToApplication = false;
#if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
#if (BOARD == BOARD_LEONARDO)
/* Enable pull-up on the IO13 pin so we can use it to select the mode */
PORTC |= (1 << 7);
Delay_MS(10);
/* If IO13 is not jumpered to ground, start the user application instead */
JumpToApplication = ((PINC & (1 << 7)) != 0);
/* Disable pull-up after the check has completed */
PORTC &= ~(1 << 7);
#elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
/* Disable JTAG debugging */
JTAG_DISABLE();
@@ -117,21 +127,41 @@ void Application_Jump_Check(void)
Delay_MS(10);
/* If the TCK pin is not jumpered to ground, start the user application instead */
JumpToApplication |= ((PINF & (1 << 4)) != 0);
JumpToApplication = ((PINF & (1 << 4)) != 0);
/* Re-enable JTAG debugging */
JTAG_ENABLE();
#else
/* Check if the device's BOOTRST fuse is set */
if (boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS) & FUSE_BOOTRST)
{
/* If the reset source was not an external reset or the key is correct, clear it and jump to the application */
if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << EXTRF);
}
else
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application;
* this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << WDRF);
}
#endif
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication |= true;
/* Don't run the user application if the reset vector is blank (no app loaded) */
bool ApplicationValid = (pgm_read_word_near(0) != 0xFFFF);
/* If a request has been made to jump to the user application, honor it */
if (JumpToApplication)
if (JumpToApplication && ApplicationValid)
{
/* Turn off the watchdog */
MCUSR &= ~(1<<WDRF);
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Clear the boot key and jump to the user application */
@@ -370,7 +400,7 @@ void EVENT_USB_Device_ControlRequest(void)
}
/* Read the byte from the USB interface and write to to the EEPROM */
eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_8());
eeprom_update_byte((uint8_t*)StartAddr, Endpoint_Read_8());
/* Adjust counters */
StartAddr++;
@@ -751,8 +781,9 @@ static void ProcessWriteCommand(void)
}
else // Start via jump
{
/* Set the flag to terminate the bootloader at next opportunity */
RunBootloader = false;
/* Set the flag to terminate the bootloader at next opportunity if a valid application has been loaded */
if (pgm_read_word_near(0) == 0xFFFF)
RunBootloader = false;
}
}
}
@@ -785,13 +816,44 @@ static void ProcessWriteCommand(void)
static void ProcessReadCommand(void)
{
const uint8_t BootloaderInfo[3] = {BOOTLOADER_VERSION, BOOTLOADER_ID_BYTE1, BOOTLOADER_ID_BYTE2};
const uint8_t SignatureInfo[3] = {AVR_SIGNATURE_1, AVR_SIGNATURE_2, AVR_SIGNATURE_3};
const uint8_t SignatureInfo[4] = {0x58, AVR_SIGNATURE_1, AVR_SIGNATURE_2, AVR_SIGNATURE_3};
uint8_t DataIndexToRead = SentCommand.Data[1];
uint8_t DataIndexToRead = SentCommand.Data[1];
bool ReadAddressInvalid = false;
if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Read bootloader info
ResponseByte = BootloaderInfo[DataIndexToRead];
if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x00)) // Read bootloader info
{
if (DataIndexToRead < 3)
ResponseByte = BootloaderInfo[DataIndexToRead];
else
ReadAddressInvalid = true;
}
else if (IS_ONEBYTE_COMMAND(SentCommand.Data, 0x01)) // Read signature byte
ResponseByte = SignatureInfo[DataIndexToRead - 0x30];
}
{
switch (DataIndexToRead)
{
case 0x30:
ResponseByte = SignatureInfo[0];
break;
case 0x31:
ResponseByte = SignatureInfo[1];
break;
case 0x60:
ResponseByte = SignatureInfo[2];
break;
case 0x61:
ResponseByte = SignatureInfo[3];
break;
default:
ReadAddressInvalid = true;
break;
}
}
if (ReadAddressInvalid)
{
/* Set the state and status variables to indicate the error */
DFU_State = dfuERROR;
DFU_Status = errADDRESS;
}
}
+5 -5
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -68,7 +68,7 @@
#define BOOTLOADER_VERSION_REV 0
/** Magic bootloader key to unlock forced application start mode. */
#define MAGIC_BOOT_KEY 0xDC42
#define MAGIC_BOOT_KEY 0xDC42
/** Complete bootloader version number expressed as a packed byte, constructed from the
* two individual bootloader version macros.
@@ -170,7 +170,7 @@
dfuMANIFEST = 7,
dfuMANIFEST_WAIT_RESET = 8,
dfuUPLOAD_IDLE = 9,
dfuERROR = 10
dfuERROR = 10
};
/** DFU command status error codes. Refer to the DFU class specification for information on each error code. */
@@ -191,7 +191,7 @@
errUSBR = 12,
errPOR = 13,
errUNKNOWN = 14,
errSTALLEDPKT = 15
errSTALLEDPKT = 15
};
/* Function Prototypes: */
+24 -6
View File
@@ -55,6 +55,30 @@
* When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the
* bootloader from the normal user application.
*
* \section Sec_Running Running the Bootloader
*
* On the USB AVR8 devices, setting the \c HWBE device fuse will cause the bootloader to run if the \c HWB pin of
* the AVR is grounded when the device is reset.
*
* The are two behaviours of this bootloader, depending on the device's fuses:
*
* <b>If the device's BOOTRST fuse is set</b>, the bootloader will run any time the system is reset from
* the external reset pin, unless no valid user application has been loaded. To initiate the bootloader, the
* device's external reset pin should be grounded momentarily.
*
* <b>If the device's BOOTRST fuse is not set</b>, the bootloader will run only if initiated via a software
* jump, or if the \c HWB pin was low during the last device reset (if the \c HWBE fuse is set).
*
* For board specific exceptions to the above, see below.
*
* \subsection SSec_XPLAIN Atmel Xplain Board
* Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the
* \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \subsection SSec_Leonardo Arduino Leonardo Board
* Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the
* \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \section Sec_Installation Driver Installation
*
* This bootloader is designed to be compatible with Atmel's provided Windows DFU class drivers. You will need to
@@ -189,12 +213,6 @@
* access.
* See <a href=https://groups.google.com/d/msg/lufa-support/CP9cy2bc8yo/kBqsOu-RBeMJ>here</a> for resolution steps.
*
* \par After loading an application, it is not run automatically on startup.
* Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. In most cases, the BOOTRST
* fuse should be disabled and the HWBE fuse used instead to run the bootloader
* when needed.
*
* \section Sec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+5 -5
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -33,10 +33,10 @@
*
* This is a header file which is be used to configure some of
* the application's compile time options, as an alternative to
* specifying the compile time constants supplied through a
* specifying the compile time constants supplied through a
* makefile or build system.
*
* For information on what each token does, refer to the
* For information on what each token does, refer to the
* \ref Sec_Options section of the application documentation.
*/
@@ -45,4 +45,4 @@
#define SECURE_MODE false
#endif
#endif
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+10 -25
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -46,7 +46,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.USBSpecification = VERSION_BCD(1,1,0),
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
@@ -55,7 +55,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = PRODUCT_ID_CODE,
.ReleaseNumber = VERSION_BCD(00.00),
.ReleaseNumber = VERSION_BCD(0,0,0),
.ManufacturerStrIndex = STRING_ID_Manufacturer,
.ProductStrIndex = STRING_ID_Product,
@@ -90,7 +90,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_DFU,
.AlternateSetting = 0,
.TotalEndpoints = 0,
@@ -111,7 +111,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
.DetachTimeout = 0x0000,
.TransferSize = 0x0C00,
.DFUSpecification = VERSION_BCD(01.10)
.DFUSpecification = VERSION_BCD(1,1,0)
}
};
@@ -119,34 +119,19 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
};
const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera");
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(8), .Type = DTYPE_String},
.UnicodeString = L"LUFA DFU"
};
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"LUFA DFU");
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
@@ -155,7 +140,7 @@ const USB_Descriptor_String_t ProductString =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
+16 -7
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -118,7 +118,7 @@
#elif defined(__AVR_AT90USB82__)
#define PRODUCT_ID_CODE 0x2FF7
#define AVR_SIGNATURE_1 0x1E
#define AVR_SIGNATURE_2 0x94
#define AVR_SIGNATURE_2 0x93
#define AVR_SIGNATURE_3 0x82
#else
#error The selected AVR part is not currently supported by this bootloader.
@@ -164,20 +164,29 @@
USB_Descriptor_DFU_Functional_t DFU_Functional;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_DFU = 0, /**< DFU interface descriptor ID */
};
/** Enum for the device string descriptor IDs within the device. Each string descriptor should
* have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors.
*/
enum StringDescriptors_t
{
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
};
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
File diff suppressed because it is too large Load Diff
+1
View File
@@ -144,6 +144,7 @@
<build type="header-file" value="Config/LUFAConfig.h"/>
<build type="header-file" value="Config/AppConfig.h"/>
<build type="distribute" subtype="user-file" value="doxyfile"/>
<build type="distribute" subtype="user-file" value="BootloaderDFU.txt"/>
<require idref="lufa.common"/>
File diff suppressed because it is too large Load Diff
+16 -9
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -45,11 +45,18 @@ BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, Boot
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
+12 -4
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -58,8 +58,13 @@ void Application_Jump_Check(void)
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
{
/* Turn off the watchdog */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Clear the boot key and jump to the user application */
MagicBootKey = 0;
// cppcheck-suppress constStatement
((void (*)(void))0x0000)();
}
@@ -98,6 +103,9 @@ static void SetupHardware(void)
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE);
MCUCR = (1 << IVSEL);
@@ -153,7 +161,7 @@ void EVENT_USB_Device_ControlRequest(void)
{
RunBootloader = false;
}
else
else if (PageAddress < BOOT_START_ADDR)
{
/* Erase the given FLASH page, ready to be programmed */
boot_page_erase(PageAddress);
+2 -4
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -67,7 +67,5 @@
void Application_Jump_Check(void) ATTR_INIT_SECTION(3);
void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
+14 -5
View File
@@ -48,7 +48,7 @@
*
* This bootloader enumerates to the host as a HID Class device, allowing for device FLASH programming through
* the supplied command line software, which is a modified version of Paul's TeensyHID Command Line loader code
* from PJRC (used with permission). This bootloader is deliberatley non-compatible with the properietary PJRC
* from PJRC (used with permission). This bootloader is deliberately non-compatible with the proprietary PJRC
* HalfKay bootloader GUI; only the command line interface software accompanying this bootloader will work with it.
*
* Out of the box this bootloader builds for the AT90USB1287 with an 8KB bootloader section size, and will fit
@@ -56,6 +56,15 @@
* all other models. If you wish to alter this size and/or change the AVR model, you will need to edit the MCU,
* FLASH_SIZE_KB and BOOT_SECTION_SIZE_KB values in the accompanying makefile.
*
* \warning <b>THIS BOOTLOADER IS NOT SECURE.</b> Malicious entities can recover written data, even if the device
* lockbits are set.
*
* \section Sec_Running Running the Bootloader
*
* This bootloader is designed to be started via the \c HWB mechanism of the USB AVRs; ground the \c HWB pin (see device
* datasheet) then momentarily ground \c /RESET to start the bootloader. This assumes the \c HWBE fuse is set and the
* \c BOOTRST fuse is cleared.
*
* \section Sec_Installation Driver Installation
*
* This bootloader uses the HID class driver inbuilt into all modern operating systems, thus no additional drivers
@@ -64,7 +73,7 @@
* \section Sec_HostApp Host Controller Application
*
* Due to licensing issues, the supplied bootloader is compatible with the HalfKay bootloader protocol designed
* by PJRC, but is non-compatible with the cross-platform loader GUI. A modified version of the open source
* by PJRC, but is <b>not compatible with the cross-platform loader GUI</b>. A modified version of the open source
* cross-platform TeensyLoader application is supplied, which can be compiled under most operating systems. The
* command-line loader application should remain compatible with genuine Teensy boards in addition to boards using
* this custom bootloader.
@@ -77,9 +86,9 @@
* \section Sec_KnownIssues Known Issues:
*
* \par After loading an application, it is not run automatically on startup.
* Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. In most cases, the BOOTRST
* fuse should be disabled and the HWBE fuse used instead to run the bootloader
* Some USB AVR boards ship with the \c BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. This booloader requires the
* \c BOOTRST be disabled and the HWBE fuse used instead to run the bootloader
* when needed.
*
* \section SSec_Options Project Options
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+14 -14
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -48,12 +48,12 @@ const USB_Descriptor_HIDReport_Datatype_t HIDReport[] =
HID_RI_USAGE_PAGE(16, 0xFFDC), /* Vendor Page 0xDC */
HID_RI_USAGE(8, 0xFB), /* Vendor Usage 0xFB */
HID_RI_COLLECTION(8, 0x01), /* Vendor Usage 1 */
HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */
HID_RI_LOGICAL_MINIMUM(8, 0x00),
HID_RI_LOGICAL_MAXIMUM(8, 0xFF),
HID_RI_REPORT_SIZE(8, 0x08),
HID_RI_REPORT_COUNT(16, (sizeof(uint16_t) + SPM_PAGESIZE)),
HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */
HID_RI_LOGICAL_MINIMUM(8, 0x00),
HID_RI_LOGICAL_MAXIMUM(8, 0xFF),
HID_RI_REPORT_SIZE(8, 0x08),
HID_RI_REPORT_COUNT(16, (sizeof(uint16_t) + SPM_PAGESIZE)),
HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
HID_RI_END_COLLECTION(0),
};
@@ -66,7 +66,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.USBSpecification = VERSION_BCD(1,1,0),
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
@@ -75,7 +75,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x2067,
.ReleaseNumber = VERSION_BCD(00.01),
.ReleaseNumber = VERSION_BCD(0,0,1),
.ManufacturerStrIndex = NO_DESCRIPTOR,
.ProductStrIndex = NO_DESCRIPTOR,
@@ -110,7 +110,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0x00,
.InterfaceNumber = INTERFACE_ID_GenericHID,
.AlternateSetting = 0x00,
.TotalEndpoints = 1,
@@ -126,7 +126,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11),
.HIDSpec = VERSION_BCD(1,1,1),
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
.HIDReportType = HID_DTYPE_Report,
@@ -151,7 +151,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
@@ -175,7 +175,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
Address = &ConfigurationDescriptor.HID_VendorHID;
Size = sizeof(USB_HID_Descriptor_HID_t);
}
else
else if (DescriptorType == HID_DTYPE_Report)
{
Address = &HIDReport;
Size = sizeof(HIDReport);
+13 -4
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -51,9 +51,18 @@
// Generic HID Interface
USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_VendorHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_GenericHID = 0, /**< GenericHID interface descriptor ID */
};
/* Macros: */
/** Endpoint address of the HID data IN endpoint. */
#define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1)
@@ -63,7 +72,7 @@
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
hid_bootloader_cli
+2 -1
View File
@@ -13,8 +13,9 @@ hid_bootloader_cli: hid_bootloader_cli.c
else ifeq ($(OS), WINDOWS)
CC = i586-mingw32msvc-gcc
CFLAGS ?= -O2 -Wall
LDLIB = -lsetupapi -lhid
hid_bootloader_cli.exe: hid_bootloader_cli.c
$(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c -lhid -lsetupapi
$(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c $(LDLIB)
else ifeq ($(OS), MACOSX)
@@ -921,21 +921,22 @@ void ihex_get_data(int addr, int len, unsigned char *bytes)
int printf_verbose(const char *format, ...)
{
va_list ap;
int r;
int r = 0;
va_start(ap, format);
if (verbose) {
r = vprintf(format, ap);
fflush(stdout);
return r;
}
return 0;
va_end(ap);
return r;
}
void delay(double seconds)
{
#ifdef WIN32
Sleep(seconds * 1000.0);
#ifdef USE_WIN32
sleep(seconds * 1000.0);
#else
usleep(seconds * 1000000.0);
#endif
@@ -948,10 +949,12 @@ void die(const char *str, ...)
va_start(ap, str);
vfprintf(stderr, str, ap);
fprintf(stderr, "\n");
va_end(ap);
exit(1);
}
#if defined(WIN32)
#if defined USE_WIN32
#define strcasecmp stricmp
#endif
@@ -1,6 +1,6 @@
"""
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
@@ -16,7 +16,7 @@
python hid_bootloader_loader.py at90usb1287 Mouse.hex
Requires the pywinusb (https://pypi.python.org/pypi/pywinusb/) and
IntelHex (http://bialix.com/intelhex/) libraries.
IntelHex (https://pypi.python.org/pypi/IntelHex/) libraries.
"""
import sys
+1
View File
@@ -109,6 +109,7 @@
<build type="module-config" subtype="path" value="Config"/>
<build type="header-file" value="Config/LUFAConfig.h"/>
<build type="distribute" subtype="user-file" value="doxyfile"/>
<build type="distribute" subtype="user-file" value="BootloaderHID.txt"/>
<build type="distribute" subtype="directory" value="HostLoaderApp"/>
<build type="distribute" subtype="directory" value="HostLoaderApp_Python"/>
File diff suppressed because it is too large Load Diff
+17 -10
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -20,7 +20,7 @@ OPTIMIZATION = s
TARGET = BootloaderHID
SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB)
LUFA_PATH = ../../LUFA
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -IConfig/
LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET)
# Flash size and bootloader section sizes of the target, in KB. These must
@@ -38,11 +38,18 @@ BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) -
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+38 -13
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -44,7 +44,7 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface =
{
.Config =
{
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_MassStorage,
.DataINEndpoint =
{
.Address = MASS_STORAGE_IN_EPADDR,
@@ -91,11 +91,11 @@ void Application_Jump_Check(void)
#if (BOARD == BOARD_LEONARDO)
/* Enable pull-up on the IO13 pin so we can use it to select the mode */
PORTC |= (1 << 7);
PORTC |= (1 << 7);
Delay_MS(10);
/* If IO13 is not jumpered to ground, start the user application instead */
JumpToApplication |= ((PINC & (1 << 7)) != 0);
JumpToApplication = ((PINC & (1 << 7)) != 0);
/* Disable pull-up after the check has completed */
PORTC &= ~(1 << 7);
@@ -108,21 +108,46 @@ void Application_Jump_Check(void)
Delay_MS(10);
/* If the TCK pin is not jumpered to ground, start the user application instead */
JumpToApplication |= ((PINF & (1 << 4)) != 0);
JumpToApplication = ((PINF & (1 << 4)) != 0);
/* Re-enable JTAG debugging */
JTAG_ENABLE();
#else
/* Check if the device's BOOTRST fuse is set */
if (boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS) & FUSE_BOOTRST)
{
/* If the reset source was not an external reset or the key is correct, clear it and jump to the application */
if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << EXTRF);
}
else
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application;
* this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << WDRF);
}
#endif
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
{
MagicBootKey = 0;
JumpToApplication = true;
}
/* Don't run the user application if the reset vector is blank (no app loaded) */
bool ApplicationValid = (pgm_read_word_near(0) != 0xFFFF);
if (JumpToApplication)
/* If a request has been made to jump to the user application, honor it */
if (JumpToApplication && ApplicationValid)
{
/* Turn off the watchdog */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Clear the boot key and jump to the user application */
MagicBootKey = 0;
// cppcheck-suppress constStatement
((void (*)(void))0x0000)();
}
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -57,6 +57,33 @@
* When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the
* bootloader from the normal user application.
*
* \warning <b>THIS BOOTLOADER IS NOT SECURE.</b> Malicious entities can recover written data, even if the device
* lockbits are set.
*
* \section Sec_Running Running the Bootloader
*
* On the USB AVR8 devices, setting the \c HWBE device fuse will cause the bootloader to run if the \c HWB pin of
* the AVR is grounded when the device is reset.
*
* The are two behaviours of this bootloader, depending on the device's fuses:
*
* <b>If the device's BOOTRST fuse is set</b>, the bootloader will run any time the system is reset from
* the external reset pin, unless no valid user application has been loaded. To initiate the bootloader, the
* device's external reset pin should be grounded momentarily.
*
* <b>If the device's BOOTRST fuse is not set</b>, the bootloader will run only if initiated via a software
* jump, or if the \c HWB pin was low during the last device reset (if the \c HWBE fuse is set).
*
* For board specific exceptions to the above, see below.
*
* \subsection SSec_XPLAIN Atmel Xplain Board
* Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the
* \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \subsection SSec_Leonardo Arduino Leonardo Board
* Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the
* \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \section Sec_Installation Driver Installation
*
* This bootloader uses the Mass Storage drivers inbuilt into all modern operating systems, thus no additional
@@ -69,7 +96,20 @@
* remove your device from the host using the host OS's ejection APIs, to ensure all data is correctly flushed to the
* bootloader's virtual filesystem and not cached in the OS's file system driver.
*
* The current device firmware can be read from the device by reading a file from the virtual FAT filesystem.
* The current device firmware can be read from the device by reading a file from the virtual FAT filesystem. Two files will
* be present:
* - <b>FLASH.BIN</b>, representing the AVR's internal flash memory
* - <b>EEPROM.BIN</b>, representing the AVR's internal EEPROM memory
*
* To convert an existing Intel HEX (.HEX) program file to a binary (.BIN) file suitable for this bootloader, run:
* \code
* avr-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature input.hex output.bin
* \endcode
* From a terminal, replacing <tt>input.hex</tt> and <tt>output.bin</tt> with the respective input and output filenames.
* AVR EEPROM data files in Intel HEX format (.EEP) uses a similar technique:
* \code
* avr-objcopy -O binary input.eep output.bin
* \endcode
*
* \warning This bootloader is currently <b>incompatible with the Apple MacOS X OS Finder GUI</b>, due to the
* large amount of meta files this OS attempts to write to the disk along with the new binaries. On
@@ -179,12 +219,6 @@
* Mass Storage bootloader, or the file system synced via an appropriate command
* (such as the OS's normal disk ejection command) before disconnecting the device.
*
* \par After loading an application, it is not run automatically on startup.
* Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. In most cases, the BOOTRST
* fuse should be disabled and the HWBE fuse used instead to run the bootloader
* when needed.
*
* \section Sec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+6 -6
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -47,7 +47,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.USBSpecification = VERSION_BCD(1,1,0),
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
@@ -56,7 +56,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x2045,
.ReleaseNumber = VERSION_BCD(00.01),
.ReleaseNumber = VERSION_BCD(0,0,1),
.ManufacturerStrIndex = NO_DESCRIPTOR,
.ProductStrIndex = NO_DESCRIPTOR,
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_MassStorage,
.AlternateSetting = 0,
.TotalEndpoints = 2,
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
+13 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -68,9 +68,19 @@
USB_Descriptor_Endpoint_t MS_DataOutEndpoint;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each interface descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_MassStorage = 0, /**< Mass storage interface descriptor ID */
};
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3) AUX_BOOT_SECTION;
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+5 -5
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -55,9 +55,9 @@
* \param[in] Acode New SCSI additional sense key to set the additional sense code to
* \param[in] Aqual New SCSI additional sense key qualifier to set the additional sense qualifier code to
*/
#define SCSI_SET_SENSE(Key, Acode, Aqual) MACROS{ SenseData.SenseKey = (Key); \
SenseData.AdditionalSenseCode = (Acode); \
SenseData.AdditionalSenseQualifier = (Aqual); }MACROE
#define SCSI_SET_SENSE(Key, Acode, Aqual) do { SenseData.SenseKey = (Key); \
SenseData.AdditionalSenseCode = (Acode); \
SenseData.AdditionalSenseQualifier = (Aqual); } while (0)
/** Macro for the \ref SCSI_Command_ReadWrite_10() function, to indicate that data is to be read from the storage medium. */
#define DATA_READ true
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+18 -18
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -99,31 +99,31 @@
/** Bit-rotates a given 8-bit value once to the right.
*
* \param x Value to rotate right once
* \param[in] x Value to rotate right once
*
* \return Bit-rotated input value, rotated once to the right.
*/
#define _ROT8(x) ((((x) & 0xFE) >> 1) | (((x) & 1) ? 0x80 : 0x00))
#define ROT8(x) ((((x) & 0xFE) >> 1) | (((x) & 1) ? 0x80 : 0x00))
/** Computes the LFN entry checksum of a MSDOS 8.3 format file entry,
* to associate a LFN entry with its short file entry.
*
* \param n0 MSDOS Filename character 1
* \param n1 MSDOS Filename character 2
* \param n2 MSDOS Filename character 3
* \param n3 MSDOS Filename character 4
* \param n4 MSDOS Filename character 5
* \param n5 MSDOS Filename character 6
* \param n6 MSDOS Filename character 7
* \param n7 MSDOS Filename character 8
* \param e0 MSDOS Extension character 1
* \param e1 MSDOS Extension character 2
* \param e2 MSDOS Extension character 3
* \param[in] n0 MSDOS Filename character 1
* \param[in] n1 MSDOS Filename character 2
* \param[in] n2 MSDOS Filename character 3
* \param[in] n3 MSDOS Filename character 4
* \param[in] n4 MSDOS Filename character 5
* \param[in] n5 MSDOS Filename character 6
* \param[in] n6 MSDOS Filename character 7
* \param[in] n7 MSDOS Filename character 8
* \param[in] e0 MSDOS Extension character 1
* \param[in] e1 MSDOS Extension character 2
* \param[in] e2 MSDOS Extension character 3
*
* \return LFN checksum of the given MSDOS 8.3 filename.
*/
#define FAT_CHECKSUM(n0, n1, n2, n3, n4, n5, n6, n7, e0, e1, e2) \
(uint8_t)(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(_ROT8(n0)+n1)+n2)+n3)+n4)+n5)+n6)+n7)+e0)+e1)+e2)
(uint8_t)(ROT8(ROT8(ROT8(ROT8(ROT8(ROT8(ROT8(ROT8(ROT8(ROT8(n0)+n1)+n2)+n3)+n4)+n5)+n6)+n7)+e0)+e1)+e2)
/** \name FAT Filesystem Flags */
//@{
@@ -274,10 +274,10 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_VIRTUAL_FAT_C)
static uint8_t ReadEEPROMByte(const uint8_t* const Address) ATTR_NEVER_INLINE;
static uint8_t ReadEEPROMByte(const uint8_t* const Address) ATTR_NO_INLINE;
static void WriteEEPROMByte(uint8_t* const Address,
const uint8_t Data) ATTR_NEVER_INLINE;
const uint8_t Data) ATTR_NO_INLINE;
static void UpdateFAT12ClusterEntry(uint8_t* const FATTable,
const uint16_t Index,
+2
View File
@@ -136,6 +136,7 @@
<build type="module-config" subtype="path" value="Config"/>
<build type="header-file" value="Config/LUFAConfig.h"/>
<build type="header-file" value="Config/AppConfig.h"/>
<build type="include-path" value="Lib"/>
<build type="header-file" value="Lib/VirtualFAT.h"/>
@@ -143,6 +144,7 @@
<build type="header-file" value="Lib/SCSI.h"/>
<build type="c-source" value="Lib/SCSI.c"/>
<build type="distribute" subtype="user-file" value="doxyfile"/>
<build type="distribute" subtype="user-file" value="BootloaderMassStorage.txt"/>
<require idref="lufa.common"/>
File diff suppressed because it is too large Load Diff
+16 -9
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -58,11 +58,18 @@ endif
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+61 -5
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -43,7 +43,7 @@ USB_ClassInfo_PRNT_Device_t TextOnly_Printer_Interface =
{
.Config =
{
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_Printer,
.DataINEndpoint =
{
.Address = PRINTER_IN_EPADDR,
@@ -119,9 +119,65 @@ uint16_t MagicBootKey ATTR_NO_INIT;
*/
void Application_Jump_Check(void)
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
bool JumpToApplication = false;
#if (BOARD == BOARD_LEONARDO)
/* Enable pull-up on the IO13 pin so we can use it to select the mode */
PORTC |= (1 << 7);
Delay_MS(10);
/* If IO13 is not jumpered to ground, start the user application instead */
JumpToApplication = ((PINC & (1 << 7)) != 0);
/* Disable pull-up after the check has completed */
PORTC &= ~(1 << 7);
#elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
/* Disable JTAG debugging */
JTAG_DISABLE();
/* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */
PORTF |= (1 << 4);
Delay_MS(10);
/* If the TCK pin is not jumpered to ground, start the user application instead */
JumpToApplication = ((PINF & (1 << 4)) != 0);
/* Re-enable JTAG debugging */
JTAG_ENABLE();
#else
/* Check if the device's BOOTRST fuse is set */
if (boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS) & FUSE_BOOTRST)
{
/* If the reset source was not an external reset or the key is correct, clear it and jump to the application */
if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << EXTRF);
}
else
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application;
* this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */
if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
JumpToApplication = true;
/* Clear reset source */
MCUSR &= ~(1 << WDRF);
}
#endif
/* Don't run the user application if the reset vector is blank (no app loaded) */
bool ApplicationValid = (pgm_read_word_near(0) != 0xFFFF);
/* If a request has been made to jump to the user application, honor it */
if (JumpToApplication && ApplicationValid)
{
/* Turn off the watchdog */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Clear the boot key and jump to the user application */
MagicBootKey = 0;
// cppcheck-suppress constStatement
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+24 -6
View File
@@ -54,6 +54,30 @@
* When the bootloader is running, the board's LED(s) will flash at regular intervals to distinguish the
* bootloader from the normal user application.
*
* \section Sec_Running Running the Bootloader
*
* On the USB AVR8 devices, setting the \c HWBE device fuse will cause the bootloader to run if the \c HWB pin of
* the AVR is grounded when the device is reset.
*
* The are two behaviours of this bootloader, depending on the device's fuses:
*
* <b>If the device's BOOTRST fuse is set</b>, the bootloader will run any time the system is reset from
* the external reset pin, unless no valid user application has been loaded. To initiate the bootloader, the
* device's external reset pin should be grounded momentarily.
*
* <b>If the device's BOOTRST fuse is not set</b>, the bootloader will run only if initiated via a software
* jump, or if the \c HWB pin was low during the last device reset (if the \c HWBE fuse is set).
*
* For board specific exceptions to the above, see below.
*
* \subsection SSec_XPLAIN Atmel Xplain Board
* Ground the USB AVR JTAG's \c TCK pin to ground when powering on the board to start the bootloader. This assumes the
* \c HWBE fuse is cleared and the \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \subsection SSec_Leonardo Arduino Leonardo Board
* Ground \c IO13 when powering the board to start the bootloader. This assumes the \c HWBE fuse is cleared and the
* \c BOOTRST fuse is set as the HWBE pin is not user accessible on this board.
*
* \section Sec_Installation Driver Installation
*
* This bootloader uses the Generic Text-Only printer drivers inbuilt into all modern operating systems, thus no
@@ -163,12 +187,6 @@
* are unable to handle true plain-text printing. For best results, the low
* level \c lpr command should be used to print new firmware to the bootloader.
*
* \par After loading an application, it is not run automatically on startup.
* Some USB AVR boards ship with the BOOTRST fuse set, causing the bootloader
* to run automatically when the device is reset. In most cases, the BOOTRST
* fuse should be disabled and the HWBE fuse used instead to run the bootloader
* when needed.
*
* \section Sec_Options Project Options
*
* The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+9 -24
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -47,7 +47,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.USBSpecification = VERSION_BCD(1,1,0),
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
@@ -56,7 +56,7 @@ const USB_Descriptor_Device_t DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x206B,
.ReleaseNumber = VERSION_BCD(00.01),
.ReleaseNumber = VERSION_BCD(0,0,1),
.ManufacturerStrIndex = STRING_ID_Manufacturer,
.ProductStrIndex = STRING_ID_Product,
@@ -91,7 +91,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
.InterfaceNumber = 0,
.InterfaceNumber = INTERFACE_ID_Printer,
.AlternateSetting = 0,
.TotalEndpoints = 2,
@@ -128,34 +128,19 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
const USB_Descriptor_String_t LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
const USB_Descriptor_String_t LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ManufacturerString =
{
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
.UnicodeString = L"Dean Camera"
};
const USB_Descriptor_String_t ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera");
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
const USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(23), .Type = DTYPE_String},
.UnicodeString = L"LUFA Printer Bootloader"
};
const USB_Descriptor_String_t ProductString = USB_STRING_DESCRIPTOR(L"LUFA Printer Bootloader");
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
@@ -164,7 +149,7 @@ const USB_Descriptor_String_t ProductString =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
+15 -6
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -66,20 +66,29 @@
USB_Descriptor_Endpoint_t Printer_DataOutEndpoint;
} USB_Descriptor_Configuration_t;
/** Enum for the device interface descriptor IDs within the device. Each string descriptor
* should have a unique ID index associated with it, which can be used to refer to the
* interface from other descriptors.
*/
enum InterfaceDescriptors_t
{
INTERFACE_ID_Printer = 0, /**< Printer interface descriptor ID */
};
/** Enum for the device string descriptor IDs within the device. Each string descriptor should
* have a unique ID index associated with it, which can be used to refer to the string from
* other descriptors.
*/
enum StringDescriptors_t
{
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */
STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */
STRING_ID_Product = 2, /**< Product string ID */
};
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const uint16_t wIndex,
const void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
File diff suppressed because it is too large Load Diff
+1
View File
@@ -147,6 +147,7 @@
<build type="module-config" subtype="path" value="Config"/>
<build type="header-file" value="Config/LUFAConfig.h"/>
<build type="distribute" subtype="user-file" value="doxyfile"/>
<build type="distribute" subtype="user-file" value="BootloaderPrinter.txt"/>
<require idref="lufa.common"/>
File diff suppressed because it is too large Load Diff
+16 -9
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -45,11 +45,18 @@ BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, Boot
# Default target
all:
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
include $(LUFA_PATH)/Build/lufa_doxygen.mk
include $(LUFA_PATH)/Build/lufa_avrdude.mk
include $(LUFA_PATH)/Build/lufa_atprogram.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
include $(DMBS_PATH)/doxygen.mk
include $(DMBS_PATH)/dfu.mk
include $(DMBS_PATH)/gcc.mk
include $(DMBS_PATH)/hid.mk
include $(DMBS_PATH)/avrdude.mk
include $(DMBS_PATH)/atprogram.mk
+4 -4
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -24,13 +24,13 @@ endif
# Need to special-case building without a per-project object directory
ifeq ($(OBJDIR),)
# If no target specified, force "clean all" and disallow parallel build
# If no target specified, force "clean all" and disallow parallel build
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := clean all
.NOTPARALLEL:
endif
# If one of the targets is to build, force "clean" beforehand and disallow parallel build
# If one of the targets is to build, force "clean" beforehand and disallow parallel build
ifneq ($(findstring all, $(MAKECMDGOALS)),)
MAKECMDGOALS := clean $(MAKECMDGOALS)
.NOTPARALLEL:
@@ -42,5 +42,5 @@ endif
$(PROJECT_DIRECTORIES):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(PROJECT_DIRECTORIES)
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -71,6 +71,10 @@ BOARD_XPLAIN = AVR8 : at90usb1287 :
BOARD_XPLAIN_REV1 = AVR8 : at90usb1287 :
BOARD_STANGE_ISP = AVR8 : at90usb162 :
BOARD_U2S = AVR8 : atmega32u2 :
BOARD_YUN = AVR8 : atmega32u4 :
BOARD_MICRO = AVR8 : atmega32u4 :
BOARD_POLOLUMICRO = AVR8 : atmega32u4 :
BOARD_XPLAINED_MINI = AVR8 : atmega32u4 :
#
# ----------------- XMEGA Boards -----------------
BOARD_A3BU_XPLAINED = XMEGA : atxmega256a3bu :
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+7 -6
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -29,10 +29,10 @@ end:
makeboardlist:
@grep "BOARD_" $(patsubst %/,%,$(LUFA_PATH))/Common/BoardTypes.h | cut -d'#' -f2 | cut -d' ' -f2 | grep "BOARD_" > BoardList.txt
testboards:
@echo "buildtest:" > BuildMakefile
@while read line; \
do \
build_cfg=`grep "$$line " BoardDeviceMap.cfg | grep -v "#" | cut -d'=' -f2- | sed 's/ //g'`; \
@@ -50,7 +50,7 @@ testboards:
printf "\t$(MAKE) -f makefile.test clean elf MCU=%s ARCH=%s BOARD=%s\n\n" $$build_mcu $$build_arch $$build_board >> BuildMakefile; \
fi; \
done < BoardList.txt
$(MAKE) -f BuildMakefile buildtest
clean:
@@ -64,5 +64,6 @@ clean:
.PHONY: all begin end makeboardlist testboards clean
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
+14 -6
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -11,9 +11,9 @@
# Run "make help" for target help.
MCU =
ARCH =
BOARD =
MCU =
ARCH =
BOARD =
F_CPU = $(F_USB)
F_USB = 8000000
OPTIMIZATION = 1
@@ -23,5 +23,13 @@ LUFA_PATH = ../../LUFA
CC_FLAGS = -Werror
DEBUG_LEVEL = 0
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_build.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
+7 -6
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -25,10 +25,10 @@ begin:
end:
@echo Build test "BootloaderTest" complete.
@echo
testbootloaders:
@echo "buildtest:" > BuildMakefile
@while read line; \
do \
build_cfg=`echo $$line | grep -v "#" | sed 's/ //g'`; \
@@ -50,7 +50,7 @@ testbootloaders:
printf "\t$(MAKE) -C $(patsubst %/,%,$(LUFA_PATH))/../Bootloaders/%s/ clean elf ARCH=%s MCU=%s BOARD=%s FLASH_SIZE_KB=%s BOOT_SECTION_SIZE_KB=%s F_USB=%s000000 DEBUG_LEVEL=0\n\n" $$build_bootloader $$build_arch $$build_mcu $$build_board $$build_flashsize $$build_bootsize $$build_fusb >> BuildMakefile; \
fi; \
done < BootloaderDeviceMap.cfg
$(MAKE) -f BuildMakefile buildtest
clean:
@@ -60,5 +60,6 @@ clean:
.PHONY: all begin end testbootloaders clean
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
+3 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -35,7 +35,7 @@
.global main
main:
# Mandatory callback needed for base compile of the USB driver
.global CALLBACK_USB_GetDescriptor
CALLBACK_USB_GetDescriptor:
+9 -9
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -37,20 +37,20 @@
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#if (ARCH == ARCH_AVR8)
#if defined(TWCR)
#include <LUFA/Drivers/Peripheral/TWI.h>
#endif
#if defined(ADC)
#include <LUFA/Drivers/Peripheral/ADC.h>
#endif
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
#include <LUFA/Drivers/Peripheral/SPI.h>
#if defined(TWCR)
#include <LUFA/Drivers/Peripheral/TWI.h>
#endif
#elif (ARCH == ARCH_XMEGA)
#include <LUFA/Drivers/Peripheral/TWI.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/Peripheral/SerialSPI.h>
#include <LUFA/Drivers/Peripheral/SPI.h>
#include <LUFA/Drivers/Peripheral/TWI.h>
#endif
+3 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -28,4 +28,4 @@
this software.
*/
#include "Modules.h"
#include "Modules.h"
+3 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -28,4 +28,4 @@
this software.
*/
#include "Modules.h"
#include "Modules.h"
+4 -3
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -62,5 +62,6 @@ clean:
.PHONY: all arch_avr8 arch_xmega arch_uc3 begin end
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
+11 -5
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -75,7 +75,7 @@ ifneq ($(ARCH), UC3)
endif
# Only check C++ compatibility on the build files, to ensure headers are C++ compatible
Test_C.c Test_CPP.c: CC_FLAGS += -Wc++-compat
Test_C.c Test_CPP.cpp: CC_FLAGS += -Wc++-compat
# Potential additional warnings to enable in the future (FIXME)
#CC_FLAGS += -Wcast-qual
@@ -83,6 +83,12 @@ Test_C.c Test_CPP.c: CC_FLAGS += -Wc++-compat
#CC_FLAGS += -Wsign-conversion
#CC_FLAGS += -pedantic
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
+3 -3
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -36,7 +36,7 @@
main:
# Force code generation of the base USB stack
call USB_Init
# Mandatory callback needed for base compile of the USB driver
.global CALLBACK_USB_GetDescriptor
CALLBACK_USB_GetDescriptor:
+2 -2
View File
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
+5 -4
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -36,7 +36,7 @@ compile:
@echo Building SingleUSBModeTest for ARCH=XMEGA in device only mode...
$(MAKE) -f makefile.test clean elf ARCH=XMEGA MCU=atxmega128a1u CC_FLAGS='-D USB_DEVICE_ONLY'
@echo Building SingleUSBModeTest for ARCH=UC3 in device only mode...
$(MAKE) -f makefile.test clean elf ARCH=UC3 MCU=uc3a0256 CC_FLAGS='-D USB_DEVICE_ONLY'
@@ -52,5 +52,6 @@ clean:
.PHONY: begin end compile clean
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
+12 -6
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -11,8 +11,8 @@
# Run "make help" for target help.
MCU =
ARCH =
MCU =
ARCH =
BOARD = NONE
F_CPU = $(F_USB)
DEBUG_LEVEL = 0
@@ -64,6 +64,12 @@ C_FLAGS += -Wnested-externs
#CC_FLAGS += -Wjump-misses-init
#CC_FLAGS += -pedantic
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_sources.mk
include $(LUFA_PATH)/Build/lufa_build.mk
# Include LUFA-specific DMBS extension modules
DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
include $(DMBS_LUFA_PATH)/lufa-sources.mk
include $(DMBS_LUFA_PATH)/lufa-gcc.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/gcc.mk
+5 -5
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -38,10 +38,10 @@ end:
@echo
%:
.PHONY: all begin end
# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa_core.mk
include $(LUFA_PATH)/Build/lufa_cppcheck.mk
# Include common DMBS build system modules
DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
include $(DMBS_PATH)/core.mk
include $(DMBS_PATH)/cppcheck.mk
+2 -2
View File
@@ -1,6 +1,6 @@
#
# LUFA Library
# Copyright (C) Dean Camera, 2013.
# Copyright (C) Dean Camera, 2017.
#
# dean [at] fourwalledcubicle [dot] com
# www.lufa-lib.org
@@ -21,4 +21,4 @@ all:
$(MAKE) -C SingleUSBModeTest $@
$(MAKE) -C StaticAnalysisTest $@
@echo
@echo LUFA build test \"make $@\" operation complete.
@echo LUFA build test \"make $@\" operation complete.
@@ -1,13 +1,13 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2013.
Copyright (C) Dean Camera, 2017.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@ -44,8 +44,8 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{
.Config =
{
.ControlInterfaceNumber = 0,
.StreamingInterfaceNumber = 1,
.ControlInterfaceNumber = INTERFACE_ID_AudioControl,
.StreamingInterfaceNumber = INTERFACE_ID_AudioStream,
.DataINEndpoint =
{
.Address = AUDIO_STREAM_EPADDR,

Some files were not shown because too many files have changed in this diff Show More