Makefile.usbmcus 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. #/*
  2. # * These are the AVR-USB-MCUs
  3. # * soldered on Arduino Micro / Leonardo and similar boards representing the main IO-MCU
  4. # * or being used on Arduino Uno (Wifi) / Mega (2560) as USB to UART converter, the USB-MCU
  5. # * The USB (DFU)-Bootloader installed per default on these devices is REPLACED by Optiboot,
  6. # * thus supporting upload via USART1 (serial1) INSTEAD of USB!!!
  7. # *
  8. # * https://github.com/Virtual-Java
  9. # *
  10. # * This file has basic CPU defintions, while many possible combinations
  11. # * of AVR_FREQ, BAUD_RATE, and UART are built by a shell script.
  12. # */
  13. HELPTEXT += "target atmega8/16/32u2, atmega16/32u4 - newer 32/44pin AVR-USB-MCUs \n"
  14. #-----------------------
  15. # ATmega 8u2
  16. #-----------------------
  17. #ATmega8u2
  18. atmega8u2atUART: TARGET = atmega8u2
  19. atmega8u2atUART: MCU_TARGET = atmega8u2
  20. atmega8u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  21. atmega8u2atUART: AVR_FREQ ?= 16000000L
  22. atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  23. ifndef PRODUCTION
  24. atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  25. endif
  26. atmega8u2:
  27. "$(MAKE)" atmega8u2atUART UART?=1
  28. atmega8u2_isp: atmega8u2
  29. atmega8u2_isp: TARGET = atmega8u2
  30. atmega8u2_isp: MCU_TARGET = atmega8u2
  31. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  32. atmega8u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  33. else ## bigboot version is 1024 Bytes long; starts earlier
  34. atmega8u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  35. endif
  36. atmega8u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  37. atmega8u2_isp: EFUSE ?= FE# = 2.7V brownout
  38. atmega8u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  39. atmega8u2_isp: isp
  40. #-----------------------
  41. # ATmega 16u2
  42. #-----------------------
  43. #ATmega16u2
  44. atmega16u2atUART: TARGET = atmega16u2
  45. atmega16u2atUART: MCU_TARGET = atmega16u2
  46. atmega16u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  47. atmega16u2atUART: AVR_FREQ ?= 16000000L
  48. atmega16u2atUART: $(PROGRAM)_atmega16u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  49. ifndef PRODUCTION
  50. atmega16u2atUART: $(PROGRAM)_atmega16u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  51. endif
  52. atmega16u2:
  53. "$(MAKE)" atmega16u2atUART UART?=1
  54. atmega16u2_isp: atmega16u2
  55. atmega16u2_isp: TARGET = atmega16u2
  56. atmega16u2_isp: MCU_TARGET = atmega16u2
  57. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  58. atmega16u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  59. else ## bigboot version is 1024 Bytes long; starts earlier
  60. atmega16u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  61. endif
  62. atmega16u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  63. atmega16u2_isp: EFUSE ?= FE# = 2.7V brownout
  64. atmega16u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  65. atmega16u2_isp: isp
  66. #-----------------------
  67. # ATmega 32u2
  68. #-----------------------
  69. #ATmega32u2
  70. atmega32u2atUART: TARGET = atmega32u2
  71. atmega32u2atUART: MCU_TARGET = atmega32u2
  72. atmega32u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  73. atmega32u2atUART: AVR_FREQ ?= 16000000L
  74. atmega32u2atUART: $(PROGRAM)_atmega32u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  75. ifndef PRODUCTION
  76. atmega32u2atUART: $(PROGRAM)_atmega32u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  77. endif
  78. atmega32u2:
  79. "$(MAKE)" atmega32u2atUART UART?=1
  80. atmega32u2_isp: atmega32u2
  81. atmega32u2_isp: TARGET = atmega32u2
  82. atmega32u2_isp: MCU_TARGET = atmega32u2
  83. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  84. atmega32u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  85. else ## bigboot version is 1024 Bytes long; starts earlier
  86. atmega32u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  87. endif
  88. atmega32u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  89. atmega32u2_isp: EFUSE ?= FE# = 2.7V brownout
  90. atmega32u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  91. atmega32u2_isp: isp
  92. #-----------------------
  93. # ATmega 16u4
  94. #-----------------------
  95. #ATmega16u4
  96. atmega16u4atUART: TARGET = atmega16u4
  97. atmega16u4atUART: MCU_TARGET = atmega16u4
  98. atmega16u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  99. atmega16u4atUART: AVR_FREQ ?= 16000000L
  100. atmega16u4atUART: $(PROGRAM)_atmega16u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  101. ifndef PRODUCTION
  102. atmega16u4atUART: $(PROGRAM)_atmega16u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  103. endif
  104. atmega16u4:
  105. # disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
  106. "$(MAKE)" atmega16u4atUART UART?=1 LED_START_FLASHES?=0
  107. atmega16u4_isp: atmega16u4
  108. atmega16u4_isp: TARGET = atmega16u4
  109. atmega16u4_isp: MCU_TARGET = atmega16u4
  110. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  111. atmega16u4_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  112. else ## bigboot version is 1024 Bytes long; starts earlier
  113. atmega16u4_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  114. endif
  115. atmega16u4_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  116. atmega16u4_isp: EFUSE ?= FB# = 2.6V brownout
  117. atmega16u4_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  118. atmega16u4_isp: isp
  119. #-----------------------
  120. # ATmega 32u4
  121. #-----------------------
  122. #ATmega32u4
  123. atmega32u4atUART: TARGET = atmega32u4
  124. atmega32u4atUART: MCU_TARGET = atmega32u4
  125. atmega32u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  126. atmega32u4atUART: AVR_FREQ ?= 16000000L
  127. atmega32u4atUART: $(PROGRAM)_atmega32u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  128. ifndef PRODUCTION
  129. atmega32u4atUART: $(PROGRAM)_atmega32u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  130. endif
  131. atmega32u4:
  132. # disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
  133. "$(MAKE)" atmega32u4atUART UART?=1 LED_START_FLASHES?=0
  134. atmega32u4_isp: atmega32u4
  135. atmega32u4_isp: TARGET = atmega32u4
  136. atmega32u4_isp: MCU_TARGET = atmega32u4
  137. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  138. atmega32u4_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  139. else ## bigboot version is 1024 Bytes long; starts earlier
  140. atmega32u4_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  141. endif
  142. atmega32u4_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  143. atmega32u4_isp: EFUSE ?= FB# = 2.6V brownout
  144. atmega32u4_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  145. atmega32u4_isp: isp
  146. #-----------------------
  147. # ATmega 32u6
  148. #-----------------------
  149. #ATmega32u6
  150. atmega32u6atUART: TARGET = atmega32u6
  151. atmega32u6atUART: MCU_TARGET = atmega32u6
  152. atmega32u6atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  153. atmega32u6atUART: AVR_FREQ ?= 16000000L
  154. atmega32u6atUART: $(PROGRAM)_atmega32u6_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  155. ifndef PRODUCTION
  156. atmega32u6atUART: $(PROGRAM)_atmega32u6_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  157. endif
  158. atmega32u6:
  159. "$(MAKE)" atmega32u6atUART UART?=1
  160. atmega32u6_isp: atmega32u6
  161. atmega32u6_isp: TARGET = atmega32u6
  162. atmega32u6_isp: MCU_TARGET = atmega32u6
  163. ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
  164. atmega32u6_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  165. else ## bigboot version is 1024 Bytes long; starts earlier
  166. atmega32u6_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  167. endif
  168. atmega32u6_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  169. atmega32u6_isp: EFUSE ?= FB# = 2.6V brownout
  170. atmega32u6_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  171. atmega32u6_isp: isp
  172. #-----------------------
  173. # AT90USB646
  174. #-----------------------
  175. #at90usb646
  176. at90usb646atUART: TARGET = at90usb646
  177. at90usb646atUART: MCU_TARGET = at90usb646
  178. at90usb646atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  179. at90usb646atUART: AVR_FREQ ?= 16000000L
  180. at90usb646atUART: $(PROGRAM)_at90usb646_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  181. ifndef PRODUCTION
  182. at90usb646atUART: $(PROGRAM)_at90usb646_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  183. endif
  184. at90usb646:
  185. "$(MAKE)" at90usb646atUART UART?=1 BIGBOOT?=1
  186. at90usb646_isp: at90usb646
  187. at90usb646_isp: TARGET = at90usb646
  188. at90usb646_isp: MCU_TARGET = at90usb646
  189. at90usb646_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  190. at90usb646_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  191. at90usb646_isp: EFUSE ?= FB# = 2.6V brownout
  192. at90usb646_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  193. at90usb646_isp: isp
  194. #-----------------------
  195. # AT90USB647
  196. #-----------------------
  197. #at90usb647
  198. at90usb647atUART: TARGET = at90usb647
  199. at90usb647atUART: MCU_TARGET = at90usb647
  200. at90usb647atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  201. at90usb647atUART: AVR_FREQ ?= 16000000L
  202. at90usb647atUART: $(PROGRAM)_at90usb647_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  203. ifndef PRODUCTION
  204. at90usb647atUART: $(PROGRAM)_at90usb647_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  205. endif
  206. at90usb647:
  207. "$(MAKE)" at90usb647atUART UART?=1 BIGBOOT?=1
  208. at90usb647_isp: at90usb647
  209. at90usb647_isp: TARGET = at90usb647
  210. at90usb647_isp: MCU_TARGET = at90usb647
  211. at90usb647_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  212. at90usb647_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  213. at90usb647_isp: EFUSE ?= FB# = 2.6V brownout
  214. at90usb647_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  215. at90usb647_isp: isp
  216. #-----------------------
  217. # AT90USB1286
  218. #-----------------------
  219. #at90usb1286
  220. at90usb1286atUART: TARGET = at90usb1286
  221. at90usb1286atUART: MCU_TARGET = at90usb1286
  222. at90usb1286atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  223. at90usb1286atUART: AVR_FREQ ?= 16000000L
  224. at90usb1286atUART: $(PROGRAM)_at90usb1286_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  225. ifndef PRODUCTION
  226. at90usb1286atUART: $(PROGRAM)_at90usb1286_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  227. endif
  228. at90usb1286:
  229. "$(MAKE)" at90usb1286atUART UART?=1 BIGBOOT?=1
  230. at90usb1286_isp: at90usb1286
  231. at90usb1286_isp: TARGET = at90usb1286
  232. at90usb1286_isp: MCU_TARGET = at90usb1286
  233. at90usb1286_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  234. at90usb1286_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  235. at90usb1286_isp: EFUSE ?= FB# = 2.6V brownout
  236. at90usb1286_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  237. at90usb1286_isp: isp
  238. #-----------------------
  239. # AT90USB1287
  240. #-----------------------
  241. #at90usb1287
  242. at90usb1287atUART: TARGET = at90usb1287
  243. at90usb1287atUART: MCU_TARGET = at90usb1287
  244. at90usb1287atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
  245. at90usb1287atUART: AVR_FREQ ?= 16000000L
  246. at90usb1287atUART: $(PROGRAM)_at90usb1287_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
  247. ifndef PRODUCTION
  248. at90usb1287atUART: $(PROGRAM)_at90usb1287_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
  249. endif
  250. at90usb1287:
  251. "$(MAKE)" at90usb1287atUART UART?=1 BIGBOOT?=1 BIGBOOT?=1
  252. at90usb1287_isp: at90usb1287
  253. at90usb1287_isp: TARGET = at90usb1287
  254. at90usb1287_isp: MCU_TARGET = at90usb1287
  255. at90usb1287_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
  256. at90usb1287_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
  257. at90usb1287_isp: EFUSE ?= FB# = 2.6V brownout
  258. at90usb1287_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
  259. at90usb1287_isp: isp