Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tag the LUFA 120730 release.

git-svn-id: http://lufa-lib.googlecode.com/svn/tags/LUFA-120730@2428 d5102386-fcda-11dd-9fdb-3debd5008f28
  • Loading branch information...
commit 9b57f660aeb9f8b94893d546d703b95928cb3640 1 parent a0a30d5
Dean authored

Showing 354 changed files with 9,632 additions and 15,385 deletions. Show diff stats Hide diff stats

  1. +2 0  Bootloaders/CDC/BootloaderAPI.c
  2. +39 33 Bootloaders/CDC/BootloaderAPITable.S
  3. +22 1 Bootloaders/CDC/BootloaderCDC.c
  4. +1 1  Bootloaders/CDC/BootloaderCDC.h
  5. +21 5 Bootloaders/CDC/Descriptors.c
  6. +4 6 Bootloaders/CDC/Doxygen.conf
  7. +19 65 Bootloaders/CDC/LUFA CDC Bootloader.inf
  8. +28 22 Bootloaders/CDC/makefile
  9. +2 0  Bootloaders/DFU/BootloaderAPI.c
  10. +38 32 Bootloaders/DFU/BootloaderAPITable.S
  11. +22 18 Bootloaders/DFU/BootloaderDFU.c
  12. +1 1  Bootloaders/DFU/BootloaderDFU.h
  13. +2 1  Bootloaders/DFU/BootloaderDFU.txt
  14. +21 5 Bootloaders/DFU/Descriptors.c
  15. +4 6 Bootloaders/DFU/Doxygen.conf
  16. +28 22 Bootloaders/DFU/makefile
  17. +1 1  Bootloaders/HID/BootloaderHID.c
  18. +4 4 Bootloaders/HID/BootloaderHID.h
  19. +4 6 Bootloaders/HID/Doxygen.conf
  20. +20 21 Bootloaders/HID/makefile
  21. +27 11 Bootloaders/makefile
  22. +73 72 BuildTests/BoardDriverTest/BoardDeviceMap.cfg
  23. +68 63 BuildTests/BoardDriverTest/makefile
  24. +0 723 BuildTests/BoardDriverTest/makefile.avr8
  25. +25 0 BuildTests/BoardDriverTest/makefile.test
  26. +0 486 BuildTests/BoardDriverTest/makefile.uc3
  27. +0 705 BuildTests/BoardDriverTest/makefile.xmega
  28. +122 62 BuildTests/BootloaderTest/BootloaderDeviceMap.cfg
  29. +64 58 BuildTests/BootloaderTest/makefile
  30. +41 41 BuildTests/ModuleTest/Dummy.S
  31. +57 57 BuildTests/ModuleTest/Modules.h
  32. +30 30 BuildTests/ModuleTest/Test_C.c
  33. +30 30 BuildTests/ModuleTest/Test_CPP.cpp
  34. +66 57 BuildTests/ModuleTest/makefile
  35. +0 742 BuildTests/ModuleTest/makefile.avr8
  36. +66 0 BuildTests/ModuleTest/makefile.test
  37. +0 513 BuildTests/ModuleTest/makefile.uc3
  38. +0 733 BuildTests/ModuleTest/makefile.xmega
  39. +42 41 BuildTests/SingleUSBModeTest/Dummy.S
  40. +32 32 BuildTests/SingleUSBModeTest/Test.c
  41. +56 45 BuildTests/SingleUSBModeTest/makefile
  42. +0 724 BuildTests/SingleUSBModeTest/makefile.avr8
  43. +67 0 BuildTests/SingleUSBModeTest/makefile.test
  44. +0 487 BuildTests/SingleUSBModeTest/makefile.uc3
  45. +0 706 BuildTests/SingleUSBModeTest/makefile.xmega
  46. +39 49 BuildTests/StaticAnalysisTest/makefile
  47. +24 19 BuildTests/makefile
  48. +2 2 Demos/Device/ClassDriver/AudioInput/AudioInput.c
  49. +4 6 Demos/Device/ClassDriver/AudioInput/Doxygen.conf
  50. +10 7 Demos/Device/ClassDriver/AudioInput/makefile
  51. +2 2 Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
  52. +4 6 Demos/Device/ClassDriver/AudioOutput/Doxygen.conf
  53. +10 7 Demos/Device/ClassDriver/AudioOutput/makefile
  54. +4 6 Demos/Device/ClassDriver/DualVirtualSerial/Doxygen.conf
  55. +19 65 Demos/Device/ClassDriver/DualVirtualSerial/LUFA DualVirtualSerial.inf
  56. +10 7 Demos/Device/ClassDriver/DualVirtualSerial/makefile
  57. +4 6 Demos/Device/ClassDriver/GenericHID/Doxygen.conf
  58. +10 7 Demos/Device/ClassDriver/GenericHID/makefile
  59. +4 6 Demos/Device/ClassDriver/Joystick/Doxygen.conf
  60. +10 7 Demos/Device/ClassDriver/Joystick/makefile
  61. +4 6 Demos/Device/ClassDriver/Keyboard/Doxygen.conf
  62. +10 7 Demos/Device/ClassDriver/Keyboard/makefile
  63. +4 6 Demos/Device/ClassDriver/KeyboardMouse/Doxygen.conf
  64. +10 7 Demos/Device/ClassDriver/KeyboardMouse/makefile
  65. +4 6 Demos/Device/ClassDriver/KeyboardMouseMultiReport/Doxygen.conf
  66. +10 7 Demos/Device/ClassDriver/KeyboardMouseMultiReport/makefile
  67. +4 6 Demos/Device/ClassDriver/MIDI/Doxygen.conf
  68. +10 7 Demos/Device/ClassDriver/MIDI/makefile
  69. +4 6 Demos/Device/ClassDriver/MassStorage/Doxygen.conf
  70. +10 7 Demos/Device/ClassDriver/MassStorage/makefile
  71. +4 6 Demos/Device/ClassDriver/MassStorageKeyboard/Doxygen.conf
  72. +10 7 Demos/Device/ClassDriver/MassStorageKeyboard/makefile
  73. +4 6 Demos/Device/ClassDriver/Mouse/Doxygen.conf
  74. +10 7 Demos/Device/ClassDriver/Mouse/makefile
  75. +4 6 Demos/Device/ClassDriver/RNDISEthernet/Doxygen.conf
  76. +37 37 Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c
  77. +5 5 Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h
  78. +10 7 Demos/Device/ClassDriver/RNDISEthernet/makefile
  79. +4 6 Demos/Device/ClassDriver/VirtualSerial/Doxygen.conf
  80. +19 65 Demos/Device/ClassDriver/VirtualSerial/LUFA VirtualSerial.inf
  81. +10 7 Demos/Device/ClassDriver/VirtualSerial/makefile
  82. +4 6 Demos/Device/ClassDriver/VirtualSerialMassStorage/Doxygen.conf
  83. +19 65 Demos/Device/ClassDriver/VirtualSerialMassStorage/LUFA VirtualSerialMassStorage.inf
  84. +10 7 Demos/Device/ClassDriver/VirtualSerialMassStorage/makefile
  85. +4 6 Demos/Device/ClassDriver/VirtualSerialMouse/Doxygen.conf
  86. +19 65 Demos/Device/ClassDriver/VirtualSerialMouse/LUFA VirtualSerialMouse.inf
  87. +10 7 Demos/Device/ClassDriver/VirtualSerialMouse/makefile
  88. +30 35 Demos/Device/ClassDriver/makefile
  89. +12 8 Demos/Device/Incomplete/Sideshow/makefile
  90. +83 83 Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
  91. +4 4 Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
  92. +148 148 Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.h
  93. +11 8 Demos/Device/Incomplete/TestAndMeasurement/makefile
  94. +4 6 Demos/Device/LowLevel/AudioInput/Doxygen.conf
  95. +10 7 Demos/Device/LowLevel/AudioInput/makefile
  96. +4 6 Demos/Device/LowLevel/AudioOutput/Doxygen.conf
  97. +10 7 Demos/Device/LowLevel/AudioOutput/makefile
  98. +4 6 Demos/Device/LowLevel/DualVirtualSerial/Doxygen.conf
  99. +19 65 Demos/Device/LowLevel/DualVirtualSerial/LUFA DualVirtualSerial.inf
  100. +10 7 Demos/Device/LowLevel/DualVirtualSerial/makefile
  101. +4 6 Demos/Device/LowLevel/GenericHID/Doxygen.conf
  102. +10 7 Demos/Device/LowLevel/GenericHID/makefile
  103. +4 6 Demos/Device/LowLevel/Joystick/Doxygen.conf
  104. +10 7 Demos/Device/LowLevel/Joystick/makefile
  105. +4 6 Demos/Device/LowLevel/Keyboard/Doxygen.conf
  106. +10 7 Demos/Device/LowLevel/Keyboard/makefile
  107. +0 1  Demos/Device/LowLevel/KeyboardMouse/Descriptors.h
  108. +4 6 Demos/Device/LowLevel/KeyboardMouse/Doxygen.conf
  109. +1 1  Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c
  110. +10 7 Demos/Device/LowLevel/KeyboardMouse/makefile
  111. +4 6 Demos/Device/LowLevel/MIDI/Doxygen.conf
  112. +10 7 Demos/Device/LowLevel/MIDI/makefile
  113. +4 6 Demos/Device/LowLevel/MassStorage/Doxygen.conf
  114. +10 7 Demos/Device/LowLevel/MassStorage/makefile
  115. +4 6 Demos/Device/LowLevel/Mouse/Doxygen.conf
  116. +10 7 Demos/Device/LowLevel/Mouse/makefile
  117. +4 6 Demos/Device/LowLevel/RNDISEthernet/Doxygen.conf
  118. +36 36 Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c
  119. +5 5 Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h
  120. +10 7 Demos/Device/LowLevel/RNDISEthernet/makefile
  121. +4 6 Demos/Device/LowLevel/VirtualSerial/Doxygen.conf
  122. +19 65 Demos/Device/LowLevel/VirtualSerial/LUFA VirtualSerial.inf
  123. +10 7 Demos/Device/LowLevel/VirtualSerial/makefile
  124. +30 27 Demos/Device/LowLevel/makefile
  125. +4 6 Demos/DualRole/ClassDriver/MouseHostDevice/Doxygen.conf
  126. +10 7 Demos/DualRole/ClassDriver/MouseHostDevice/makefile
  127. +29 4 Demos/DualRole/ClassDriver/makefile
  128. +1 1  Demos/DualRole/makefile
  129. +231 231 Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c
  130. +77 77 Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.h
  131. +4 6 Demos/Host/ClassDriver/AndroidAccessoryHost/Doxygen.conf
  132. +10 7 Demos/Host/ClassDriver/AndroidAccessoryHost/makefile
  133. +4 6 Demos/Host/ClassDriver/AudioInputHost/Doxygen.conf
  134. +10 7 Demos/Host/ClassDriver/AudioInputHost/makefile
  135. +4 6 Demos/Host/ClassDriver/AudioOutputHost/Doxygen.conf
  136. +10 7 Demos/Host/ClassDriver/AudioOutputHost/makefile
  137. +4 6 Demos/Host/ClassDriver/JoystickHostWithParser/Doxygen.conf
  138. +10 7 Demos/Host/ClassDriver/JoystickHostWithParser/makefile
  139. +4 6 Demos/Host/ClassDriver/KeyboardHost/Doxygen.conf
  140. +10 7 Demos/Host/ClassDriver/KeyboardHost/makefile
  141. +4 6 Demos/Host/ClassDriver/KeyboardHostWithParser/Doxygen.conf
  142. +10 7 Demos/Host/ClassDriver/KeyboardHostWithParser/makefile
  143. +4 6 Demos/Host/ClassDriver/MIDIHost/Doxygen.conf
  144. +1 1  Demos/Host/ClassDriver/MIDIHost/MIDIHost.c
  145. +10 7 Demos/Host/ClassDriver/MIDIHost/makefile
  146. +4 6 Demos/Host/ClassDriver/MassStorageHost/Doxygen.conf
  147. +10 7 Demos/Host/ClassDriver/MassStorageHost/makefile
  148. +4 6 Demos/Host/ClassDriver/MouseHost/Doxygen.conf
  149. +10 7 Demos/Host/ClassDriver/MouseHost/makefile
  150. +4 6 Demos/Host/ClassDriver/MouseHostWithParser/Doxygen.conf
  151. +10 7 Demos/Host/ClassDriver/MouseHostWithParser/makefile
  152. +4 6 Demos/Host/ClassDriver/PrinterHost/Doxygen.conf
  153. +10 7 Demos/Host/ClassDriver/PrinterHost/makefile
  154. +4 6 Demos/Host/ClassDriver/RNDISEthernetHost/Doxygen.conf
  155. +10 7 Demos/Host/ClassDriver/RNDISEthernetHost/makefile
  156. +4 6 Demos/Host/ClassDriver/StillImageHost/Doxygen.conf
  157. +10 7 Demos/Host/ClassDriver/StillImageHost/makefile
  158. +4 6 Demos/Host/ClassDriver/VirtualSerialHost/Doxygen.conf
  159. +10 7 Demos/Host/ClassDriver/VirtualSerialHost/makefile
  160. +30 31 Demos/Host/ClassDriver/makefile
  161. +4 6 Demos/Host/LowLevel/AndroidAccessoryHost/Doxygen.conf
  162. +10 7 Demos/Host/LowLevel/AndroidAccessoryHost/makefile
  163. +4 6 Demos/Host/LowLevel/AudioInputHost/Doxygen.conf
  164. +10 7 Demos/Host/LowLevel/AudioInputHost/makefile
  165. +4 6 Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf
  166. +10 7 Demos/Host/LowLevel/AudioOutputHost/makefile
  167. +4 6 Demos/Host/LowLevel/GenericHIDHost/Doxygen.conf
  168. +10 7 Demos/Host/LowLevel/GenericHIDHost/makefile
  169. +4 6 Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf
  170. +10 7 Demos/Host/LowLevel/JoystickHostWithParser/makefile
  171. +4 6 Demos/Host/LowLevel/KeyboardHost/Doxygen.conf
  172. +10 7 Demos/Host/LowLevel/KeyboardHost/makefile
  173. +4 6 Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf
  174. +10 7 Demos/Host/LowLevel/KeyboardHostWithParser/makefile
  175. +4 6 Demos/Host/LowLevel/MIDIHost/Doxygen.conf
  176. +10 7 Demos/Host/LowLevel/MIDIHost/makefile
  177. +4 6 Demos/Host/LowLevel/MassStorageHost/Doxygen.conf
  178. +1 1  Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
  179. +10 7 Demos/Host/LowLevel/MassStorageHost/makefile
  180. +4 6 Demos/Host/LowLevel/MouseHost/Doxygen.conf
  181. +10 7 Demos/Host/LowLevel/MouseHost/makefile
  182. +4 6 Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf
  183. +10 7 Demos/Host/LowLevel/MouseHostWithParser/makefile
  184. +4 6 Demos/Host/LowLevel/PrinterHost/Doxygen.conf
  185. +3 0  Demos/Host/LowLevel/PrinterHost/PrinterHost.txt
  186. +10 7 Demos/Host/LowLevel/PrinterHost/makefile
  187. +4 6 Demos/Host/LowLevel/RNDISEthernetHost/Doxygen.conf
  188. +10 7 Demos/Host/LowLevel/RNDISEthernetHost/makefile
  189. +4 6 Demos/Host/LowLevel/StillImageHost/Doxygen.conf
  190. +10 7 Demos/Host/LowLevel/StillImageHost/makefile
  191. +4 6 Demos/Host/LowLevel/VirtualSerialHost/Doxygen.conf
  192. +10 7 Demos/Host/LowLevel/VirtualSerialHost/makefile
  193. +30 32 Demos/Host/LowLevel/makefile
  194. +1 1  LUFA.pnproj
  195. +61 0 LUFA/Build/HID_EEPROM_Loader/HID_EEPROM_Loader.c
  196. +40 0 LUFA/Build/HID_EEPROM_Loader/makefile
  197. +0 54 LUFA/Build/lufa.avrdude.in
  198. +0 182 LUFA/Build/lufa.build.in
  199. +0 73 LUFA/Build/lufa.core.in
  200. +0 52 LUFA/Build/lufa.doxygen.in
  201. +0 86 LUFA/Build/lufa.sources.in
  202. +101 0 LUFA/Build/lufa_atprogram.mk
  203. +84 0 LUFA/Build/lufa_avrdude.mk
  204. +296 0 LUFA/Build/lufa_build.mk
  205. +152 0 LUFA/Build/lufa_core.mk
  206. +104 0 LUFA/Build/lufa_cppcheck.mk
  207. +93 71 LUFA/Build/{lufa.dfu.in → lufa_dfu.mk}
  208. +81 0 LUFA/Build/lufa_doxygen.mk
  209. +88 0 LUFA/Build/lufa_hid.mk
  210. +116 0 LUFA/Build/lufa_sources.mk
  211. +1 0  LUFA/CodeTemplates/LUFAConfig.h
  212. +36 33 LUFA/CodeTemplates/makefile_template
  213. +0 715 LUFA/CodeTemplates/makefile_template.avr8
  214. +0 489 LUFA/CodeTemplates/makefile_template.uc3
  215. +0 707 LUFA/CodeTemplates/makefile_template.xmega
  216. +19 1 LUFA/Common/ArchitectureSpecific.h
  217. +1 1  LUFA/Common/Attributes.h
  218. +3 0  LUFA/Common/BoardTypes.h
  219. +2 1  LUFA/Common/Common.h
  220. +6 7 LUFA/Doxygen.conf
  221. +846 0 LUFA/DoxygenPages/BuildSystem.txt
  222. +9 2 LUFA/DoxygenPages/ChangeLog.txt
  223. +4 0 LUFA/DoxygenPages/CompileTimeTokens.txt
  224. +3 1 LUFA/DoxygenPages/CompilingApps.txt
  225. +46 31 LUFA/DoxygenPages/ConfiguringApps.txt
  226. +1 0  LUFA/DoxygenPages/DevelopingWithLUFA.txt
  227. +5 2 LUFA/DoxygenPages/DeviceSupport.txt
  228. +106 106 LUFA/DoxygenPages/ExportingLibrary.txt
  229. +0 2  LUFA/DoxygenPages/FutureChanges.txt
  230. +0 5 LUFA/DoxygenPages/Groups.txt
  231. +44 40 LUFA/DoxygenPages/KnownIssues.txt
  232. +7 0 LUFA/DoxygenPages/LUFAPoweredProjects.txt
  233. +4 1 LUFA/DoxygenPages/MigrationInformation.txt
  234. +6 3 LUFA/DoxygenPages/ProgrammingApps.txt
  235. +1,123 1,122 LUFA/DoxygenPages/Style/Style.css
  236. +161 161 LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h
  237. +207 207 LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h
  238. +2 2 LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h
  239. +161 161 LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h
  240. +3 3 LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h
  241. +103 0 LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h
  242. +143 0 LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h
  243. +3 3 LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h
  244. +112 112 LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h
  245. +195 195 LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h
  246. +3 1 LUFA/Drivers/Board/Buttons.h
  247. +1 1  LUFA/Drivers/Board/Joystick.h
  248. +4 2 LUFA/Drivers/Board/LEDs.h
  249. +1 1  LUFA/Drivers/Board/UC3/EVK1101/Buttons.h
  250. +1 1  LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h
  251. +75 75 LUFA/Drivers/USB/Class/AndroidAccessoryClass.h
  252. +127 127 LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h
  253. +2 2 LUFA/Drivers/USB/Class/Device/AudioClassDevice.h
  254. +3 1 LUFA/Drivers/USB/Class/Device/CDCClassDevice.h
  255. +1 1  LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h
  256. +421 421 LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c
  257. +313 313 LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h
  258. +3 1 LUFA/Drivers/USB/Class/Host/CDCClassHost.h
  259. +1 1  LUFA/Drivers/USB/Class/Host/HIDClassHost.h
  260. +1 1  LUFA/Drivers/USB/Class/Host/MIDIClassHost.h
  261. +2 2 LUFA/Drivers/USB/Class/Host/RNDISClassHost.c
  262. +273 273 LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c
  263. +647 647 LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h
  264. +6 1 LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h
  265. +221 221 LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c
Sorry, we could not display the entire diff because too many files (354) changed.
2  Bootloaders/CDC/BootloaderAPI.c
@@ -38,12 +38,14 @@
38 38 void BootloaderAPI_ErasePage(const uint32_t Address)
39 39 {
40 40 boot_page_erase_safe(Address);
  41 + boot_spm_busy_wait();
41 42 boot_rww_enable();
42 43 }
43 44
44 45 void BootloaderAPI_WritePage(const uint32_t Address)
45 46 {
46 47 boot_page_write_safe(Address);
  48 + boot_spm_busy_wait();
47 49 boot_rww_enable();
48 50 }
49 51
72 Bootloaders/CDC/BootloaderAPITable.S
... ... @@ -1,6 +1,6 @@
1 1 /*
2 2 LUFA Library
3   - Copyright (C) Dean Camera, 2011.
  3 + Copyright (C) Dean Camera, 2012.
4 4
5 5 dean [at] fourwalledcubicle [dot] com
6 6 www.lufa-lib.org
@@ -28,41 +28,44 @@
28 28 this software.
29 29 */
30 30
31   -; Bootloader API Jump Table
32   -.section .apitable, "ax"
33   -
34 31 ; Trampolines to actual API implementations if the target address is outside the
35 32 ; range of a rjmp instruction (can happen with large bootloader sections)
36   -.org 0
37   -BootloaderAPI_ErasePage_Trampoline:
38   - jmp BootloaderAPI_ErasePage
39   -BootloaderAPI_WritePage_Trampoline:
40   - jmp BootloaderAPI_WritePage
41   -BootloaderAPI_FillWord_Trampoline:
42   - jmp BootloaderAPI_FillWord
43   -BootloaderAPI_ReadSignature_Trampoline:
44   - jmp BootloaderAPI_ReadSignature
45   -BootloaderAPI_ReadFuse_Trampoline:
46   - jmp BootloaderAPI_ReadFuse
47   -BootloaderAPI_ReadLock_Trampoline:
48   - jmp BootloaderAPI_ReadLock
49   -BootloaderAPI_WriteLock_Trampoline:
50   - jmp BootloaderAPI_WriteLock
51   -BootloaderAPU_UNUSED1:
52   - ret
53   -BootloaderAPU_UNUSED2:
54   - ret
55   -BootloaderAPU_UNUSED3:
56   - ret
57   -BootloaderAPU_UNUSED4:
58   - ret
59   -BootloaderAPU_UNUSED5:
60   - ret
  33 +.section .apitable_trampolines, "ax"
  34 +.global BootloaderAPI_Trampolines
  35 +BootloaderAPI_Trampolines:
  36 +
  37 + BootloaderAPI_ErasePage_Trampoline:
  38 + jmp BootloaderAPI_ErasePage
  39 + BootloaderAPI_WritePage_Trampoline:
  40 + jmp BootloaderAPI_WritePage
  41 + BootloaderAPI_FillWord_Trampoline:
  42 + jmp BootloaderAPI_FillWord
  43 + BootloaderAPI_ReadSignature_Trampoline:
  44 + jmp BootloaderAPI_ReadSignature
  45 + BootloaderAPI_ReadFuse_Trampoline:
  46 + jmp BootloaderAPI_ReadFuse
  47 + BootloaderAPI_ReadLock_Trampoline:
  48 + jmp BootloaderAPI_ReadLock
  49 + BootloaderAPI_WriteLock_Trampoline:
  50 + jmp BootloaderAPI_WriteLock
  51 + BootloaderAPU_UNUSED1:
  52 + ret
  53 + BootloaderAPU_UNUSED2:
  54 + ret
  55 + BootloaderAPU_UNUSED3:
  56 + ret
  57 + BootloaderAPU_UNUSED4:
  58 + ret
  59 + BootloaderAPU_UNUSED5:
  60 + ret
  61 +
  62 +
61 63
62 64 ; API function jump table
63   -.org (96 - 32)
  65 +.section .apitable_jumptable, "ax"
64 66 .global BootloaderAPI_JumpTable
65 67 BootloaderAPI_JumpTable:
  68 +
66 69 rjmp BootloaderAPI_ErasePage_Trampoline
67 70 rjmp BootloaderAPI_WritePage_Trampoline
68 71 rjmp BootloaderAPI_FillWord_Trampoline
@@ -76,10 +79,13 @@ BootloaderAPI_JumpTable:
76 79 rjmp BootloaderAPU_UNUSED4 ; UNUSED ENTRY 4
77 80 rjmp BootloaderAPU_UNUSED5 ; UNUSED ENTRY 5
78 81
  82 +
  83 +
79 84 ; Bootloader table signatures and information
80   -.org (96 - 8)
81   -BootloaderAPI_Signatures:
  85 +.section .apitable_signatures, "ax"
82 86 .global BootloaderAPI_Signatures
  87 +BootloaderAPI_Signatures:
  88 +
83 89 .long BOOT_START_ADDR ; Start address of the bootloader
84   - .word 0xCDC1 ; Signature for the CDC class bootloader, V1
  90 + .word 0xDFB1 ; Signature for the DFU class bootloader, V1
85 91 .word 0xDCFB ; Signature for a LUFA class bootloader
23 Bootloaders/CDC/BootloaderCDC.c
@@ -61,7 +61,7 @@ static bool RunBootloader = true;
61 61 * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value
62 62 * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start.
63 63 */
64   -uint32_t MagicBootKey ATTR_NO_INIT;
  64 +uint16_t MagicBootKey ATTR_NO_INIT;
65 65
66 66
67 67 /** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application
@@ -70,8 +70,29 @@ uint32_t MagicBootKey ATTR_NO_INIT;
70 70 */
71 71 void Application_Jump_Check(void)
72 72 {
  73 + bool JumpToApplication = false;
  74 +
  75 + #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
  76 + /* Disable JTAG debugging */
  77 + JTAG_DISABLE();
  78 +
  79 + /* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */
  80 + PORTF |= (1 << 4);
  81 + Delay_MS(10);
  82 +
  83 + /* If the TCK pin is not jumpered to ground, start the user application instead */
  84 + JumpToApplication |= ((PINF & (1 << 4)) != 0);
  85 +
  86 + /* Re-enable JTAG debugging */
  87 + JTAG_ENABLE();
  88 + #endif
  89 +
73 90 /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
74 91 if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
  92 + JumpToApplication |= true;
  93 +
  94 + /* If a request has been made to jump to the user application, honor it */
  95 + if (JumpToApplication)
75 96 {
76 97 /* Turn off the watchdog */
77 98 MCUSR &= ~(1<<WDRF);
2  Bootloaders/CDC/BootloaderCDC.h
@@ -69,7 +69,7 @@
69 69 #define SOFTWARE_IDENTIFIER "LUFACDC"
70 70
71 71 /** Magic bootloader key to unlock forced application start mode. */
72   - #define MAGIC_BOOT_KEY 0xDC42CACA
  72 + #define MAGIC_BOOT_KEY 0xDC42
73 73
74 74 /* Type Defines: */
75 75 /** Type define for a non-returning pointer to the start of the loaded application in flash memory. */
26 Bootloaders/CDC/Descriptors.c
@@ -57,8 +57,8 @@ const USB_Descriptor_Device_t DeviceDescriptor =
57 57 .ProductID = 0x204A,
58 58 .ReleaseNumber = VERSION_BCD(01.00),
59 59
60   - .ManufacturerStrIndex = NO_DESCRIPTOR,
61   - .ProductStrIndex = 0x01,
  60 + .ManufacturerStrIndex = 0x01,
  61 + .ProductStrIndex = 0x02,
62 62 .SerialNumStrIndex = NO_DESCRIPTOR,
63 63
64 64 .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
@@ -185,15 +185,26 @@ const USB_Descriptor_String_t LanguageString =
185 185 .UnicodeString = {LANGUAGE_ID_ENG}
186 186 };
187 187
  188 +/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
  189 + * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  190 + * Descriptor.
  191 + */
  192 +const USB_Descriptor_String_t PROGMEM ManufacturerString =
  193 +{
  194 + .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
  195 +
  196 + .UnicodeString = L"Dean Camera"
  197 +};
  198 +
188 199 /** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
189 200 * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
190 201 * Descriptor.
191 202 */
192 203 const USB_Descriptor_String_t ProductString =
193 204 {
194   - .Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
  205 + .Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
195 206
196   - .UnicodeString = L"AVR CDC Bootloader"
  207 + .UnicodeString = L"LUFA CDC Bootloader"
197 208 };
198 209
199 210 /** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors"
@@ -228,7 +239,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
228 239 Address = &LanguageString;
229 240 Size = LanguageString.Header.Size;
230 241 }
231   - else
  242 + else if (DescriptorNumber == 0x01)
  243 + {
  244 + Address = &ManufacturerString;
  245 + Size = ManufacturerString.Header.Size;
  246 + }
  247 + else if (DescriptorNumber == 0x02)
232 248 {
233 249 Address = &ProductString;
234 250 Size = ProductString.Header.Size;
10 Bootloaders/CDC/Doxygen.conf
... ... @@ -1,4 +1,4 @@
1   -# Doxyfile 1.8.1
  1 +# Doxyfile 1.8.1.2
2 2
3 3 # This file describes the settings to be used by the documentation system
4 4 # doxygen (www.doxygen.org) for a project.
@@ -588,7 +588,7 @@ FILE_VERSION_FILTER =
588 588
589 589 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
590 590 # by doxygen. The layout file controls the global structure of the generated
591   -# output files in an output format independent way. The create the layout file
  591 +# output files in an output format independent way. To create the layout file
592 592 # that represents doxygen's defaults, run doxygen with the -l option.
593 593 # You can optionally specify a file name after the option, if omitted
594 594 # DoxygenLayout.xml will be used as the name of the layout file.
@@ -804,7 +804,7 @@ INLINE_SOURCES = NO
804 804
805 805 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
806 806 # doxygen to hide any special comment blocks from generated source code
807   -# fragments. Normal C and C++ comments will always remain visible.
  807 +# fragments. Normal C, C++ and Fortran comments will always remain visible.
808 808
809 809 STRIP_CODE_COMMENTS = YES
810 810
@@ -956,9 +956,7 @@ HTML_TIMESTAMP = NO
956 956
957 957 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
958 958 # documentation will contain sections that can be hidden and shown after the
959   -# page has loaded. For this to work a browser that supports
960   -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
961   -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
  959 +# page has loaded.
962 960
963 961 HTML_DYNAMIC_SECTIONS = YES
964 962
84 Bootloaders/CDC/LUFA CDC Bootloader.inf
... ... @@ -1,78 +1,36 @@
1 1 ;************************************************************
2 2 ; Windows USB CDC ACM Setup File
3 3 ; Copyright (c) 2000 Microsoft Corporation
4   -
  4 +;************************************************************
5 5
6 6 [Version]
7 7 Signature="$Windows NT$"
8 8 Class=Ports
9 9 ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
10 10 Provider=%MFGNAME%
11   -LayoutFile=layout.inf
12   -CatalogFile=%MFGFILENAME%.cat
13   -DriverVer=11/15/2007,5.1.2600.0
  11 +DriverVer=7/1/2012,10.0.0.0
14 12
15 13 [Manufacturer]
16   -%MFGNAME%=DeviceList, NTamd64
17   -
18   -[DestinationDirs]
19   -DefaultDestDir=12
20   -
21   -
22   -;------------------------------------------------------------------------------
23   -; Windows 2000/XP/Vista-32bit Sections
24   -;------------------------------------------------------------------------------
25   -
26   -[DriverInstall.nt]
27   -include=mdmcpq.inf
28   -CopyFiles=DriverCopyFiles.nt
29   -AddReg=DriverInstall.nt.AddReg
30   -
31   -[DriverCopyFiles.nt]
32   -usbser.sys,,,0x20
33   -
34   -[DriverInstall.nt.AddReg]
35   -HKR,,DevLoader,,*ntkern
36   -HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
37   -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
  14 +%MFGNAME%=DeviceList, NTx86, NTamd64, NTia64
38 15
39   -[DriverInstall.nt.Services]
40   -AddService=usbser, 0x00000002, DriverService.nt
41   -
42   -[DriverService.nt]
43   -DisplayName=%SERVICE%
44   -ServiceType=1
45   -StartType=3
46   -ErrorControl=1
47   -ServiceBinary=%12%\%DRIVERFILENAME%.sys
48   -
49   -;------------------------------------------------------------------------------
50   -; Vista-64bit Sections
51   -;------------------------------------------------------------------------------
52   -
53   -[DriverInstall.NTamd64]
54   -include=mdmcpq.inf
55   -CopyFiles=DriverCopyFiles.NTamd64
56   -AddReg=DriverInstall.NTamd64.AddReg
  16 +[SourceDisksNames]
57 17
58   -[DriverCopyFiles.NTamd64]
59   -%DRIVERFILENAME%.sys,,,0x20
  18 +[SourceDisksFiles]
60 19
61   -[DriverInstall.NTamd64.AddReg]
62   -HKR,,DevLoader,,*ntkern
63   -HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
64   -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
  20 +[DestinationDirs]
  21 +DefaultDestDir=12
65 22
66   -[DriverInstall.NTamd64.Services]
67   -AddService=usbser, 0x00000002, DriverService.NTamd64
  23 +[DriverInstall]
  24 +Include=mdmcpq.inf
  25 +CopyFiles=FakeModemCopyFileSection
  26 +AddReg=DriverInstall.AddReg
68 27
69   -[DriverService.NTamd64]
70   -DisplayName=%SERVICE%
71   -ServiceType=1
72   -StartType=3
73   -ErrorControl=1
74   -ServiceBinary=%12%\%DRIVERFILENAME%.sys
  28 +[DriverInstall.Services]
  29 +Include=mdmcpq.inf
  30 +AddService=usbser, 0x00000002, LowerFilter_Service_Inst
75 31
  32 +[DriverInstall.AddReg]
  33 +HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider"
76 34
77 35 ;------------------------------------------------------------------------------
78 36 ; Vendor and Product ID Definitions
@@ -83,14 +41,14 @@ ServiceBinary=%12%\%DRIVERFILENAME%.sys
83 41 ; Note: One INF file can be used for multiple devices with different VID and PIDs.
84 42 ; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
85 43 ;------------------------------------------------------------------------------
86   -[SourceDisksFiles]
87   -[SourceDisksNames]
88 44 [DeviceList]
89 45 %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A
90 46
91 47 [DeviceList.NTamd64]
92 48 %DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A
93 49
  50 +[DeviceList.NTia64]
  51 +%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_204A
94 52
95 53 ;------------------------------------------------------------------------------
96 54 ; String Definitions
@@ -98,9 +56,5 @@ ServiceBinary=%12%\%DRIVERFILENAME%.sys
98 56 ;Modify these strings to customize your device
99 57 ;------------------------------------------------------------------------------
100 58 [Strings]
101   -MFGFILENAME="CDC_vista"
102   -DRIVERFILENAME ="usbser"
103 59 MFGNAME="http://www.lufa-lib.org"
104   -INSTDISK="LUFA CDC Bootloader Driver Installer"
105   -DESCRIPTION="Communications Port"
106   -SERVICE="USB RS-232 Emulation Driver"
  60 +DESCRIPTION="LUFA CDC Class Bootloader"
50 Bootloaders/CDC/makefile
@@ -9,20 +9,6 @@
9 9 # LUFA Project Makefile.
10 10 # --------------------------------------
11 11
12   -# Starting byte address of the bootloader, as a byte address - computed via the formula
13   -# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024)
14   -#
15   -# Note that the bootloader size and start address given in AVRStudio is in words and not
16   -# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
17   -FLASH_SIZE_KB = 128
18   -BOOT_SECTION_SIZE_KB = 8
19   -
20   -# Formulas used to calculate the starting address of the Bootloader section, and the User Application
21   -# API jump table (for more information on the latter, see the bootloader documentation). These formulas
22   -# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
23   -BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
24   -BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
25   -
26 12 MCU = at90usb1287
27 13 ARCH = AVR8
28 14 BOARD = USBKEY
@@ -31,16 +17,36 @@ F_USB = $(F_CPU)
31 17 OPTIMIZATION = s
32 18 TARGET = BootloaderCDC
33 19 SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB)
34   -LUFA_PATH = ../../LUFA/
35   -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START)
36   -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) -Wl,--undefined=BootloaderAPI_JumpTable
  20 +LUFA_PATH = ../../LUFA
  21 +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
  22 +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
  23 +
  24 +# Flash size and bootloader section sizes of the target, in KB. These must
  25 +# match the target's total FLASH size and the bootloader size set in the
  26 +# device's fuses.
  27 +FLASH_SIZE_KB = 128
  28 +BOOT_SECTION_SIZE_KB = 8
  29 +
  30 +# Bootloader address calculation formulas (requires the "bc" unix utility)
  31 +# Do not modify these macros, but rather modify the depedant values above.
  32 +BOOT_START_OFFSET = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
  33 +BOOT_SEC_OFFSET = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - $(strip $(1)))" | bc)
  34 +
  35 +# Bootloader linker section flags for relocating the API table sections to
  36 +# known FLASH addresses - these should not normally be user-edited.
  37 +BOOT_SECTION_LD_FLAG = -Wl,--section-start=.apitable_$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=BootloaderAPI_$(strip $(2))
  38 +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, trampolines, Trampolines, 96)
  39 +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, jumptable, JumpTable, 32)
  40 +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, signatures, Signatures, 8)
37 41
38 42 # Default target
39 43 all:
40 44
41 45 # Include LUFA build script makefiles
42   -include $(LUFA_PATH)/Build/lufa.core.in
43   -include $(LUFA_PATH)/Build/lufa.sources.in
44   -include $(LUFA_PATH)/Build/lufa.build.in
45   -include $(LUFA_PATH)/Build/lufa.doxygen.in
46   -include $(LUFA_PATH)/Build/lufa.avrdude.in
  46 +include $(LUFA_PATH)/Build/lufa_core.mk
  47 +include $(LUFA_PATH)/Build/lufa_sources.mk
  48 +include $(LUFA_PATH)/Build/lufa_build.mk
  49 +include $(LUFA_PATH)/Build/lufa_cppcheck.mk
  50 +include $(LUFA_PATH)/Build/lufa_doxygen.mk
  51 +include $(LUFA_PATH)/Build/lufa_avrdude.mk
  52 +include $(LUFA_PATH)/Build/lufa_atprogram.mk
2  Bootloaders/DFU/BootloaderAPI.c
@@ -38,12 +38,14 @@
38 38 void BootloaderAPI_ErasePage(const uint32_t Address)
39 39 {
40 40 boot_page_erase_safe(Address);
  41 + boot_spm_busy_wait();
41 42 boot_rww_enable();
42 43 }
43 44
44 45 void BootloaderAPI_WritePage(const uint32_t Address)
45 46 {
46 47 boot_page_write_safe(Address);
  48 + boot_spm_busy_wait();
47 49 boot_rww_enable();
48 50 }
49 51
70 Bootloaders/DFU/BootloaderAPITable.S
@@ -7,7 +7,7 @@
7 7 */
8 8
9 9 /*
10   - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  10 + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11 11
12 12 Permission to use, copy, modify, distribute, and sell this
13 13 software and its documentation for any purpose is hereby granted
@@ -28,41 +28,44 @@
28 28 this software.
29 29 */
30 30
31   -; Bootloader API Jump Table
32   -.section .apitable, "ax"
33   -
34 31 ; Trampolines to actual API implementations if the target address is outside the
35 32 ; range of a rjmp instruction (can happen with large bootloader sections)
36   -.org 0
37   -BootloaderAPI_ErasePage_Trampoline:
38   - jmp BootloaderAPI_ErasePage
39   -BootloaderAPI_WritePage_Trampoline:
40   - jmp BootloaderAPI_WritePage
41   -BootloaderAPI_FillWord_Trampoline:
42   - jmp BootloaderAPI_FillWord
43   -BootloaderAPI_ReadSignature_Trampoline:
44   - jmp BootloaderAPI_ReadSignature
45   -BootloaderAPI_ReadFuse_Trampoline:
46   - jmp BootloaderAPI_ReadFuse
47   -BootloaderAPI_ReadLock_Trampoline:
48   - jmp BootloaderAPI_ReadLock
49   -BootloaderAPI_WriteLock_Trampoline:
50   - jmp BootloaderAPI_WriteLock
51   -BootloaderAPU_UNUSED1:
52   - ret
53   -BootloaderAPU_UNUSED2:
54   - ret
55   -BootloaderAPU_UNUSED3:
56   - ret
57   -BootloaderAPU_UNUSED4:
58   - ret
59   -BootloaderAPU_UNUSED5:
60   - ret
  33 +.section .apitable_trampolines, "ax"
  34 +.global BootloaderAPI_Trampolines
  35 +BootloaderAPI_Trampolines:
  36 +
  37 + BootloaderAPI_ErasePage_Trampoline:
  38 + jmp BootloaderAPI_ErasePage
  39 + BootloaderAPI_WritePage_Trampoline:
  40 + jmp BootloaderAPI_WritePage
  41 + BootloaderAPI_FillWord_Trampoline:
  42 + jmp BootloaderAPI_FillWord
  43 + BootloaderAPI_ReadSignature_Trampoline:
  44 + jmp BootloaderAPI_ReadSignature
  45 + BootloaderAPI_ReadFuse_Trampoline:
  46 + jmp BootloaderAPI_ReadFuse
  47 + BootloaderAPI_ReadLock_Trampoline:
  48 + jmp BootloaderAPI_ReadLock
  49 + BootloaderAPI_WriteLock_Trampoline:
  50 + jmp BootloaderAPI_WriteLock
  51 + BootloaderAPU_UNUSED1:
  52 + ret
  53 + BootloaderAPU_UNUSED2:
  54 + ret
  55 + BootloaderAPU_UNUSED3:
  56 + ret
  57 + BootloaderAPU_UNUSED4:
  58 + ret
  59 + BootloaderAPU_UNUSED5:
  60 + ret
  61 +
  62 +
61 63
62 64 ; API function jump table
63   -.org (96 - 32)
  65 +.section .apitable_jumptable, "ax"
64 66 .global BootloaderAPI_JumpTable
65 67 BootloaderAPI_JumpTable:
  68 +
66 69 rjmp BootloaderAPI_ErasePage_Trampoline
67 70 rjmp BootloaderAPI_WritePage_Trampoline
68 71 rjmp BootloaderAPI_FillWord_Trampoline
@@ -76,10 +79,13 @@ BootloaderAPI_JumpTable:
76 79 rjmp BootloaderAPU_UNUSED4 ; UNUSED ENTRY 4
77 80 rjmp BootloaderAPU_UNUSED5 ; UNUSED ENTRY 5
78 81
  82 +
  83 +
79 84 ; Bootloader table signatures and information
80   -.org (96 - 8)
81   -BootloaderAPI_Signatures:
  85 +.section .apitable_signatures, "ax"
82 86 .global BootloaderAPI_Signatures
  87 +BootloaderAPI_Signatures:
  88 +
83 89 .long BOOT_START_ADDR ; Start address of the bootloader
84 90 .word 0xDFB1 ; Signature for the DFU class bootloader, V1
85 91 .word 0xDCFB ; Signature for a LUFA class bootloader
40 Bootloaders/DFU/BootloaderDFU.c
@@ -97,7 +97,7 @@ static uint16_t EndAddr = 0x0000;
97 97 * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value
98 98 * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start.
99 99 */
100   -uint32_t MagicBootKey ATTR_NO_INIT;
  100 +uint16_t MagicBootKey ATTR_NO_INIT;
101 101
102 102
103 103 /** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application
@@ -106,8 +106,29 @@ uint32_t MagicBootKey ATTR_NO_INIT;
106 106 */
107 107 void Application_Jump_Check(void)
108 108 {
  109 + bool JumpToApplication = false;
  110 +
  111 + #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
  112 + /* Disable JTAG debugging */
  113 + JTAG_DISABLE();
  114 +
  115 + /* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */
  116 + PORTF |= (1 << 4);
  117 + Delay_MS(10);
  118 +
  119 + /* If the TCK pin is not jumpered to ground, start the user application instead */
  120 + JumpToApplication |= ((PINF & (1 << 4)) != 0);
  121 +
  122 + /* Re-enable JTAG debugging */
  123 + JTAG_ENABLE();
  124 + #endif
  125 +
109 126 /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */
110 127 if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
  128 + JumpToApplication |= true;
  129 +
  130 + /* If a request has been made to jump to the user application, honor it */
  131 + if (JumpToApplication)
111 132 {
112 133 /* Turn off the watchdog */
113 134 MCUSR &= ~(1<<WDRF);
@@ -130,23 +151,6 @@ int main(void)
130 151 /* Configure hardware required by the bootloader */
131 152 SetupHardware();
132 153
133   - #if ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1))
134   - /* Disable JTAG debugging */
135   - MCUCR |= (1 << JTD);
136   - MCUCR |= (1 << JTD);
137   -
138   - /* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */
139   - PORTF |= (1 << 4);
140   - Delay_MS(10);
141   -
142   - /* If the TCK pin is not jumpered to ground, start the user application instead */
143   - RunBootloader = (!(PINF & (1 << 4)));
144   -
145   - /* Re-enable JTAG debugging */
146   - MCUCR &= ~(1 << JTD);
147   - MCUCR &= ~(1 << JTD);
148   - #endif
149   -
150 154 /* Turn on first LED on the board to indicate that the bootloader has started */
151 155 LEDs_SetAllLEDs(LEDS_LED1);
152 156
2  Bootloaders/DFU/BootloaderDFU.h
@@ -62,7 +62,7 @@
62 62 #define BOOTLOADER_VERSION_REV 0
63 63
64 64 /** Magic bootloader key to unlock forced application start mode. */
65   - #define MAGIC_BOOT_KEY 0xDC42CACA
  65 + #define MAGIC_BOOT_KEY 0xDC42
66 66
67 67 /** Complete bootloader version number expressed as a packed byte, constructed from the
68 68 * two individual bootloader version macros.
3  Bootloaders/DFU/BootloaderDFU.txt
@@ -38,7 +38,8 @@
38 38 * </tr>
39 39 * <tr>
40 40 * <td><b>Supported USB Speeds:</b></td>
41   - * <td>Full Speed Mode</td>
  41 + * <td>Low Speed Mode \n
  42 + * Full Speed Mode</td>
42 43 * </tr>
43 44 * </table>
44 45 *
26 Bootloaders/DFU/Descriptors.c
@@ -57,8 +57,8 @@ const USB_Descriptor_Device_t DeviceDescriptor =
57 57 .ProductID = PRODUCT_ID_CODE,
58 58 .ReleaseNumber = VERSION_BCD(00.00),
59 59
60   - .ManufacturerStrIndex = NO_DESCRIPTOR,
61   - .ProductStrIndex = 0x01,
  60 + .ManufacturerStrIndex = 0x01,
  61 + .ProductStrIndex = 0x02,
62 62 .SerialNumStrIndex = NO_DESCRIPTOR,
63 63
64 64 .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
@@ -126,15 +126,26 @@ const USB_Descriptor_String_t LanguageString =
126 126 .UnicodeString = {LANGUAGE_ID_ENG}
127 127 };
128 128
  129 +/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
  130 + * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  131 + * Descriptor.
  132 + */
  133 +const USB_Descriptor_String_t PROGMEM ManufacturerString =
  134 +{
  135 + .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
  136 +
  137 + .UnicodeString = L"Dean Camera"
  138 +};
  139 +
129 140 /** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
130 141 * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
131 142 * Descriptor.
132 143 */
133 144 const USB_Descriptor_String_t ProductString =
134 145 {
135   - .Header = {.Size = USB_STRING_LEN(18), .Type = DTYPE_String},
  146 + .Header = {.Size = USB_STRING_LEN(19), .Type = DTYPE_String},
136 147
137   - .UnicodeString = L"AVR DFU Bootloader"
  148 + .UnicodeString = L"LUFA DFU Bootloader"
138 149 };
139 150
140 151 /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
@@ -169,7 +180,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
169 180 Address = &LanguageString;
170 181 Size = LanguageString.Header.Size;
171 182 }
172   - else
  183 + else if (DescriptorNumber == 0x01)
  184 + {
  185 + Address = &ManufacturerString;
  186 + Size = ManufacturerString.Header.Size;
  187 + }
  188 + else if (DescriptorNumber == 0x02)
173 189 {
174 190 Address = &ProductString;
175 191 Size = ProductString.Header.Size;
10 Bootloaders/DFU/Doxygen.conf
... ... @@ -1,4 +1,4 @@
1   -# Doxyfile 1.8.1
  1 +# Doxyfile 1.8.1.2
2 2
3 3 # This file describes the settings to be used by the documentation system
4 4 # doxygen (www.doxygen.org) for a project.
@@ -588,7 +588,7 @@ FILE_VERSION_FILTER =
588 588
589 589 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
590 590 # by doxygen. The layout file controls the global structure of the generated
591   -# output files in an output format independent way. The create the layout file
  591 +# output files in an output format independent way. To create the layout file
592 592 # that represents doxygen's defaults, run doxygen with the -l option.
593 593 # You can optionally specify a file name after the option, if omitted
594 594 # DoxygenLayout.xml will be used as the name of the layout file.
@@ -804,7 +804,7 @@ INLINE_SOURCES = NO
804 804
805 805 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
806 806 # doxygen to hide any special comment blocks from generated source code
807   -# fragments. Normal C and C++ comments will always remain visible.
  807 +# fragments. Normal C, C++ and Fortran comments will always remain visible.
808 808
809 809 STRIP_CODE_COMMENTS = YES
810 810
@@ -956,9 +956,7 @@ HTML_TIMESTAMP = NO
956 956
957 957 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
958 958 # documentation will contain sections that can be hidden and shown after the
959   -# page has loaded. For this to work a browser that supports
960   -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
961   -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
  959 +# page has loaded.
962 960
963 961 HTML_DYNAMIC_SECTIONS = YES
964 962
50 Bootloaders/DFU/makefile
@@ -9,20 +9,6 @@
9 9 # LUFA Project Makefile.
10 10 # --------------------------------------
11 11
12   -# Starting byte address of the bootloader, as a byte address - computed via the formula
13   -# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024)
14   -#
15   -# Note that the bootloader size and start address given in AVRStudio is in words and not
16   -# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
17   -FLASH_SIZE_KB = 128
18   -BOOT_SECTION_SIZE_KB = 8
19   -
20   -# Formulas used to calculate the starting address of the Bootloader section, and the User Application
21   -# API jump table (for more information on the latter, see the bootloader documentation). These formulas
22   -# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
23   -BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
24   -BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
25   -
26 12 MCU = at90usb1287
27 13 ARCH = AVR8
28 14 BOARD = USBKEY
@@ -31,16 +17,36 @@ F_USB = $(F_CPU)
31 17 OPTIMIZATION = s
32 18 TARGET = BootloaderDFU
33 19 SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB)
34   -LUFA_PATH = ../../LUFA/
35   -CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START)
36   -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START) -Wl,--section-start=.apitable=$(BOOT_API_TABLESTART) -Wl,--undefined=BootloaderAPI_JumpTable
  20 +LUFA_PATH = ../../LUFA
  21 +CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
  22 +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
  23 +
  24 +# Flash size and bootloader section sizes of the target, in KB. These must
  25 +# match the target's total FLASH size and the bootloader size set in the
  26 +# device's fuses.
  27 +FLASH_SIZE_KB = 128
  28 +BOOT_SECTION_SIZE_KB = 8
  29 +
  30 +# Bootloader address calculation formulas (requires the "bc" unix utility)
  31 +# Do not modify these macros, but rather modify the depedant values above.
  32 +BOOT_START_OFFSET = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
  33 +BOOT_SEC_OFFSET = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - $(strip $(1)))" | bc)
  34 +
  35 +# Bootloader linker section flags for relocating the API table sections to
  36 +# known FLASH addresses - these should not normally be user-edited.
  37 +BOOT_SECTION_LD_FLAG = -Wl,--section-start=.apitable_$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=BootloaderAPI_$(strip $(2))
  38 +BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, trampolines, Trampolines, 96)
  39 +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, jumptable, JumpTable, 32)
  40 +BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, signatures, Signatures, 8)
37 41
38 42 # Default target
39 43 all:
40 44
41 45 # Include LUFA build script makefiles
42   -include $(LUFA_PATH)/Build/lufa.core.in
43   -include $(LUFA_PATH)/Build/lufa.sources.in
44   -include $(LUFA_PATH)/Build/lufa.build.in
45   -include $(LUFA_PATH)/Build/lufa.doxygen.in
46   -include $(LUFA_PATH)/Build/lufa.avrdude.in
  46 +include $(LUFA_PATH)/Build/lufa_core.mk
  47 +include $(LUFA_PATH)/Build/lufa_sources.mk
  48 +include $(LUFA_PATH)/Build/lufa_build.mk
  49 +include $(LUFA_PATH)/Build/lufa_cppcheck.mk
  50 +include $(LUFA_PATH)/Build/lufa_doxygen.mk
  51 +include $(LUFA_PATH)/Build/lufa_avrdude.mk
  52 +include $(LUFA_PATH)/Build/lufa_atprogram.mk
2  Bootloaders/HID/BootloaderHID.c
@@ -46,7 +46,7 @@ static bool RunBootloader = true;
46 46 * low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value
47 47 * \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start.
48 48 */
49   -uint32_t MagicBootKey ATTR_NO_INIT;
  49 +uint16_t MagicBootKey ATTR_NO_INIT;
50 50
51 51
52 52 /** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application
8 Bootloaders/HID/BootloaderHID.h
@@ -30,11 +30,11 @@
30 30
31 31 /** \file
32 32 *
33   - * Header file for TeensyHID.c.
  33 + * Header file for BootloaderHID.c.
34 34 */
35 35
36   -#ifndef _TEENSYHID_H_
37   -#define _TEENSYHID_H_
  36 +#ifndef _BOOTLOADERHID_H_
  37 +#define _BOOTLOADERHID_H_
38 38
39 39 /* Includes: */
40 40 #include <avr/io.h>
@@ -53,7 +53,7 @@
53 53 #define COMMAND_STARTAPPLICATION 0xFFFF
54 54
55 55 /** Magic bootloader key to unlock forced application start mode. */
56   - #define MAGIC_BOOT_KEY 0xDC42CACA
  56 + #define MAGIC_BOOT_KEY 0xDC42
57 57
58 58 /* Function Prototypes: */
59 59 static void SetupHardware(void);
10 Bootloaders/HID/Doxygen.conf
... ... @@ -1,4 +1,4 @@
1   -# Doxyfile 1.8.1
  1 +# Doxyfile 1.8.1.2
2 2
3 3 # This file describes the settings to be used by the documentation system
4 4 # doxygen (www.doxygen.org) for a project.
@@ -588,7 +588,7 @@ FILE_VERSION_FILTER =
588 588
589 589 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
590 590 # by doxygen. The layout file controls the global structure of the generated
591   -# output files in an output format independent way. The create the layout file
  591 +# output files in an output format independent way. To create the layout file
592 592 # that represents doxygen's defaults, run doxygen with the -l option.
593 593 # You can optionally specify a file name after the option, if omitted
594 594 # DoxygenLayout.xml will be used as the name of the layout file.
@@ -805,7 +805,7 @@ INLINE_SOURCES = NO
805 805
806 806 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
807 807 # doxygen to hide any special comment blocks from generated source code
808   -# fragments. Normal C and C++ comments will always remain visible.
  808 +# fragments. Normal C, C++ and Fortran comments will always remain visible.
809 809
810 810 STRIP_CODE_COMMENTS = YES
811 811
@@ -957,9 +957,7 @@ HTML_TIMESTAMP = NO
957 957
958 958 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
959 959 # documentation will contain sections that can be hidden and shown after the
960   -# page has loaded. For this to work a browser that supports
961   -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
962   -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
  960 +# page has loaded.
963 961
964 962 HTML_DYNAMIC_SECTIONS = YES
965 963
41 Bootloaders/HID/makefile
@@ -9,20 +9,6 @@
9 9 # LUFA Project Makefile.
10 10 # --------------------------------------
11 11
12   -# Starting byte address of the bootloader, as a byte address - computed via the formula
13   -# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024)
14   -#
15   -# Note that the bootloader size and start address given in AVRStudio is in words and not
16   -# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
17   -FLASH_SIZE_KB = 128
18   -BOOT_SECTION_SIZE_KB = 8
19   -
20   -# Formulas used to calculate the starting address of the Bootloader section, and the User Application
21   -# API jump table (for more information on the latter, see the bootloader documentation). These formulas
22   -# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
23   -BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
24   -BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
25   -
26 12 MCU = at90usb1287
27 13 ARCH = AVR8
28 14 BOARD = USBKEY
@@ -31,16 +17,29 @@ F_USB = $(F_CPU)
31 17 OPTIMIZATION = s
32 18 TARGET = BootloaderHID
33 19 SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB)
34   -LUFA_PATH = ../../LUFA/
  20 +LUFA_PATH = ../../LUFA
35 21 CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
36   -LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START)
  22 +LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET)
  23 +
  24 +# Flash size and bootloader section sizes of the target, in KB. These must
  25 +# match the target's total FLASH size and the bootloader size set in the
  26 +# device's fuses.
  27 +FLASH_SIZE_KB := 128
  28 +BOOT_SECTION_SIZE_KB := 8
  29 +
  30 +# Bootloader address calculation formulas (requires the "bc" unix utility)
  31 +# Do not modify these macros, but rather modify the depedant values above.
  32 +BOOT_START_OFFSET = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
  33 +BOOT_SEC_OFFSET = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - $(strip $(1)))" | bc)
37 34
38 35 # Default target
39 36 all:
40 37
41 38 # Include LUFA build script makefiles
42   -include $(LUFA_PATH)/Build/lufa.core.in
43   -include $(LUFA_PATH)/Build/lufa.sources.in
44   -include $(LUFA_PATH)/Build/lufa.build.in
45   -include $(LUFA_PATH)/Build/lufa.doxygen.in
46   -include $(LUFA_PATH)/Build/lufa.avrdude.in
  39 +include $(LUFA_PATH)/Build/lufa_core.mk
  40 +include $(LUFA_PATH)/Build/lufa_sources.mk
  41 +include $(LUFA_PATH)/Build/lufa_build.mk
  42 +include $(LUFA_PATH)/Build/lufa_cppcheck.mk
  43 +include $(LUFA_PATH)/Build/lufa_doxygen.mk
  44 +include $(LUFA_PATH)/Build/lufa_avrdude.mk
  45 +include $(LUFA_PATH)/Build/lufa_atprogram.mk
38 Bootloaders/makefile
@@ -13,18 +13,34 @@
13 13 # custom LUFA library build options are reflected in the compiled
14 14 # code.
15 15
16   -all:
17   - $(MAKE) -C CDC clean
18   - $(MAKE) -C CDC all
  16 +PROJECT_DIRECTORIES := $(shell ls -d */)