mcu_selection.mk 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. MCU_ORIG := $(MCU)
  2. ifneq ($(findstring MKL26Z64, $(MCU)),)
  3. # Cortex version
  4. MCU = cortex-m0plus
  5. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  6. ARMV = 6
  7. ## chip/board settings
  8. # - the next two should match the directories in
  9. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  10. # OR
  11. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  12. MCU_FAMILY = KINETIS
  13. MCU_SERIES = KL2x
  14. # Linker script to use
  15. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  16. # or <keyboard_dir>/ld/
  17. MCU_LDSCRIPT ?= MKL26Z64
  18. # Startup code to use
  19. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  20. MCU_STARTUP ?= kl2x
  21. # Board: it should exist either in <chibios>/os/hal/boards/,
  22. # <keyboard_dir>/boards/, or drivers/boards/
  23. BOARD ?= PJRC_TEENSY_LC
  24. endif
  25. ifneq ($(findstring MK20DX128, $(MCU)),)
  26. # Cortex version
  27. MCU = cortex-m4
  28. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  29. ARMV = 7
  30. ## chip/board settings
  31. # - the next two should match the directories in
  32. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  33. # OR
  34. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  35. MCU_FAMILY = KINETIS
  36. MCU_SERIES = K20x
  37. # Linker script to use
  38. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  39. # or <keyboard_dir>/ld/
  40. MCU_LDSCRIPT ?= MK20DX128
  41. # Startup code to use
  42. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  43. MCU_STARTUP ?= k20x5
  44. # Board: it should exist either in <chibios>/os/hal/boards/,
  45. # <keyboard_dir>/boards/, or drivers/boards/
  46. BOARD ?= PJRC_TEENSY_3
  47. endif
  48. ifneq ($(findstring MK20DX256, $(MCU)),)
  49. # Cortex version
  50. MCU = cortex-m4
  51. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  52. ARMV = 7
  53. ## chip/board settings
  54. # - the next two should match the directories in
  55. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  56. # OR
  57. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  58. MCU_FAMILY = KINETIS
  59. MCU_SERIES = K20x
  60. # Linker script to use
  61. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  62. # or <keyboard_dir>/ld/
  63. MCU_LDSCRIPT ?= MK20DX256
  64. # Startup code to use
  65. # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
  66. MCU_STARTUP ?= k20x7
  67. # Board: it should exist either in <chibios>/os/hal/boards/,
  68. # <keyboard_dir>/boards/, or drivers/boards/
  69. BOARD ?= PJRC_TEENSY_3_1
  70. endif
  71. ifneq ($(findstring MK64FX512, $(MCU)),)
  72. # Cortex version
  73. MCU = cortex-m4
  74. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  75. ARMV = 7
  76. ## chip/board settings
  77. # - the next two should match the directories in
  78. # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  79. MCU_FAMILY = KINETIS
  80. MCU_SERIES = K60x
  81. # Linker script to use
  82. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  83. # or <keyboard_dir>/ld/
  84. MCU_LDSCRIPT ?= MK64FX512
  85. # Startup code to use
  86. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  87. MCU_STARTUP ?= k60x
  88. # Board: it should exist either in <chibios>/os/hal/boards/,
  89. # <keyboard_dir>/boards/, or drivers/boards/
  90. BOARD ?= PJRC_TEENSY_3_5
  91. endif
  92. ifneq ($(findstring MK66FX1M0, $(MCU)),)
  93. # Cortex version
  94. MCU = cortex-m4
  95. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  96. ARMV = 7
  97. ## chip/board settings
  98. # - the next two should match the directories in
  99. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  100. # OR
  101. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  102. MCU_FAMILY = KINETIS
  103. MCU_SERIES = MK66F18
  104. # Linker script to use
  105. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  106. # or <keyboard_dir>/ld/
  107. MCU_LDSCRIPT ?= MK66FX1M0
  108. # Startup code to use
  109. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  110. MCU_STARTUP ?= MK66F18
  111. # Board: it should exist either in <chibios>/os/hal/boards/,
  112. # <keyboard_dir>/boards/, or drivers/boards/
  113. BOARD ?= PJRC_TEENSY_3_6
  114. endif
  115. ifneq ($(findstring RP2040, $(MCU)),)
  116. # Cortex version
  117. MCU = cortex-m0plus
  118. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  119. CHIBIOS_PORT = ARMv6-M-RP2
  120. ## chip/board settings
  121. # - the next two should match the directories in
  122. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  123. # OR
  124. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  125. MCU_FAMILY = RP
  126. MCU_SERIES = RP2040
  127. # Linker script to use
  128. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  129. # or <keyboard_dir>/ld/
  130. STARTUPLD_CONTRIB = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld
  131. MCU_LDSCRIPT ?= RP2040_FLASH_TIMECRIT
  132. LDFLAGS += -L $(STARTUPLD_CONTRIB)
  133. # Startup code to use
  134. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  135. MCU_STARTUP ?= rp2040
  136. # Board: it should exist either in <chibios>/os/hal/boards/,
  137. # <keyboard_dir>/boards/, or drivers/boards/
  138. BOARD ?= GENERIC_PROMICRO_RP2040
  139. # Default UF2 Bootloader settings
  140. UF2_FAMILY ?= RP2040
  141. FIRMWARE_FORMAT ?= uf2
  142. endif
  143. ifneq ($(findstring STM32F042, $(MCU)),)
  144. # Cortex version
  145. MCU = cortex-m0
  146. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  147. ARMV = 6
  148. ## chip/board settings
  149. # - the next two should match the directories in
  150. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  151. # OR
  152. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  153. MCU_FAMILY = STM32
  154. MCU_SERIES = STM32F0xx
  155. # Linker script to use
  156. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  157. # or <keyboard_dir>/ld/
  158. MCU_LDSCRIPT ?= STM32F042x6
  159. # Startup code to use
  160. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  161. MCU_STARTUP ?= stm32f0xx
  162. # Board: it should exist either in <chibios>/os/hal/boards/,
  163. # <keyboard_dir>/boards/, or drivers/boards/
  164. BOARD ?= GENERIC_STM32_F042X6
  165. USE_FPU ?= no
  166. # UF2 settings
  167. UF2_FAMILY ?= STM32F0
  168. # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced.
  169. # This ensures that the EEPROM page buffer fits into RAM
  170. USE_PROCESS_STACKSIZE = 0x600
  171. USE_EXCEPTIONS_STACKSIZE = 0x300
  172. # Bootloader address for STM32 DFU
  173. STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC400
  174. endif
  175. ifneq ($(findstring STM32F072, $(MCU)),)
  176. # Cortex version
  177. MCU = cortex-m0
  178. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  179. ARMV = 6
  180. ## chip/board settings
  181. # - the next two should match the directories in
  182. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  183. # OR
  184. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  185. MCU_FAMILY = STM32
  186. MCU_SERIES = STM32F0xx
  187. # Linker script to use
  188. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  189. # or <keyboard_dir>/ld/
  190. MCU_LDSCRIPT ?= STM32F072xB
  191. # Startup code to use
  192. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  193. MCU_STARTUP ?= stm32f0xx
  194. # Board: it should exist either in <chibios>/os/hal/boards/,
  195. # <keyboard_dir>/boards/, or drivers/boards/
  196. BOARD ?= GENERIC_STM32_F072XB
  197. USE_FPU ?= no
  198. # UF2 settings
  199. UF2_FAMILY ?= STM32F0
  200. # Bootloader address for STM32 DFU
  201. STM32_BOOTLOADER_ADDRESS ?= 0x1FFFC800
  202. endif
  203. ifneq ($(findstring STM32F103, $(MCU)),)
  204. # Cortex version
  205. MCU = cortex-m3
  206. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  207. ARMV = 7
  208. ## chip/board settings
  209. # - the next two should match the directories in
  210. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  211. # OR
  212. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  213. MCU_FAMILY = STM32
  214. MCU_SERIES = STM32F1xx
  215. # Linker script to use
  216. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  217. # or <keyboard_dir>/ld/
  218. MCU_LDSCRIPT ?= STM32F103x8
  219. # Startup code to use
  220. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  221. MCU_STARTUP ?= stm32f1xx
  222. # Board: it should exist either in <chibios>/os/hal/boards/,
  223. # <keyboard_dir>/boards/, or drivers/boards/
  224. BOARD ?= GENERIC_STM32_F103
  225. USE_FPU ?= no
  226. # UF2 settings
  227. UF2_FAMILY ?= STM32F1
  228. endif
  229. ifneq ($(findstring STM32F303, $(MCU)),)
  230. # Cortex version
  231. MCU = cortex-m4
  232. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  233. ARMV = 7
  234. ## chip/board settings
  235. # - the next two should match the directories in
  236. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  237. # OR
  238. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  239. MCU_FAMILY = STM32
  240. MCU_SERIES = STM32F3xx
  241. # Linker script to use
  242. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  243. # or <keyboard_dir>/ld/
  244. MCU_LDSCRIPT ?= STM32F303xC
  245. # Startup code to use
  246. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  247. MCU_STARTUP ?= stm32f3xx
  248. # Board: it should exist either in <chibios>/os/hal/boards/,
  249. # <keyboard_dir>/boards/, or drivers/boards/
  250. BOARD ?= GENERIC_STM32_F303XC
  251. USE_FPU ?= yes
  252. # UF2 settings
  253. UF2_FAMILY ?= STM32F3
  254. # Bootloader address for STM32 DFU
  255. STM32_BOOTLOADER_ADDRESS ?= 0x1FFFD800
  256. endif
  257. ifneq ($(findstring STM32F401, $(MCU)),)
  258. # Cortex version
  259. MCU = cortex-m4
  260. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  261. ARMV = 7
  262. ## chip/board settings
  263. # - the next two should match the directories in
  264. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  265. # OR
  266. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  267. MCU_FAMILY = STM32
  268. MCU_SERIES = STM32F4xx
  269. # Linker script to use
  270. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  271. # or <keyboard_dir>/ld/
  272. ifeq ($(strip $(BOOTLOADER)), tinyuf2)
  273. MCU_LDSCRIPT ?= STM32F401xC_tinyuf2
  274. else
  275. MCU_LDSCRIPT ?= STM32F401xC
  276. endif
  277. # Startup code to use
  278. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  279. MCU_STARTUP ?= stm32f4xx
  280. # Board: it should exist either in <chibios>/os/hal/boards/,
  281. # <keyboard_dir>/boards/, or drivers/boards/
  282. BOARD ?= GENERIC_STM32_F401XC
  283. USE_FPU ?= yes
  284. # UF2 settings
  285. UF2_FAMILY ?= STM32F4
  286. # Bootloader address for STM32 DFU
  287. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  288. endif
  289. ifneq ($(findstring STM32F405, $(MCU)),)
  290. # Cortex version
  291. MCU = cortex-m4
  292. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  293. ARMV = 7
  294. ## chip/board settings
  295. # - the next two should match the directories in
  296. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  297. # OR
  298. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  299. MCU_FAMILY = STM32
  300. MCU_SERIES = STM32F4xx
  301. # Linker script to use
  302. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  303. # or <keyboard_dir>/ld/
  304. MCU_LDSCRIPT ?= STM32F405xG
  305. # Startup code to use
  306. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  307. MCU_STARTUP ?= stm32f4xx
  308. # Board: it should exist either in <chibios>/os/hal/boards/,
  309. # <keyboard_dir>/boards/, or drivers/boards/
  310. BOARD ?= GENERIC_STM32_F405XG
  311. USE_FPU ?= yes
  312. # UF2 settings
  313. UF2_FAMILY ?= STM32F4
  314. # Bootloader address for STM32 DFU
  315. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  316. endif
  317. ifneq ($(findstring STM32F407, $(MCU)),)
  318. # Cortex version
  319. MCU = cortex-m4
  320. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  321. ARMV = 7
  322. ## chip/board settings
  323. # - the next two should match the directories in
  324. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  325. # OR
  326. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  327. MCU_FAMILY = STM32
  328. MCU_SERIES = STM32F4xx
  329. # Linker script to use
  330. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  331. # or <keyboard_dir>/ld/
  332. MCU_LDSCRIPT ?= STM32F407xE
  333. # Startup code to use
  334. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  335. MCU_STARTUP ?= stm32f4xx
  336. # Board: it should exist either in <chibios>/os/hal/boards/,
  337. # <keyboard_dir>/boards/, or drivers/boards/
  338. BOARD ?= GENERIC_STM32_F407XE
  339. USE_FPU ?= yes
  340. # UF2 settings
  341. UF2_FAMILY ?= STM32F4
  342. # Bootloader address for STM32 DFU
  343. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  344. endif
  345. ifneq ($(findstring STM32F411, $(MCU)),)
  346. # Cortex version
  347. MCU = cortex-m4
  348. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  349. ARMV = 7
  350. ## chip/board settings
  351. # - the next two should match the directories in
  352. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  353. # OR
  354. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  355. MCU_FAMILY = STM32
  356. MCU_SERIES = STM32F4xx
  357. # Linker script to use
  358. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  359. # or <keyboard_dir>/ld/
  360. ifeq ($(strip $(BOOTLOADER)), tinyuf2)
  361. MCU_LDSCRIPT ?= STM32F411xE_tinyuf2
  362. else
  363. MCU_LDSCRIPT ?= STM32F411xE
  364. endif
  365. # Startup code to use
  366. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  367. MCU_STARTUP ?= stm32f4xx
  368. # Board: it should exist either in <chibios>/os/hal/boards/,
  369. # <keyboard_dir>/boards/, or drivers/boards/
  370. BOARD ?= GENERIC_STM32_F411XE
  371. USE_FPU ?= yes
  372. # UF2 settings
  373. UF2_FAMILY ?= STM32F4
  374. # Bootloader address for STM32 DFU
  375. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  376. endif
  377. ifneq ($(findstring STM32F446, $(MCU)),)
  378. # Cortex version
  379. MCU = cortex-m4
  380. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  381. ARMV = 7
  382. ## chip/board settings
  383. # - the next two should match the directories in
  384. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  385. # OR
  386. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  387. MCU_FAMILY = STM32
  388. MCU_SERIES = STM32F4xx
  389. # Linker script to use
  390. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  391. # or <keyboard_dir>/ld/
  392. MCU_LDSCRIPT ?= STM32F446xE
  393. # Startup code to use
  394. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  395. MCU_STARTUP ?= stm32f4xx
  396. # Board: it should exist either in <chibios>/os/hal/boards/,
  397. # <keyboard_dir>/boards/, or drivers/boards/
  398. BOARD ?= GENERIC_STM32_F446XE
  399. USE_FPU ?= yes
  400. # Bootloader address for STM32 DFU
  401. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  402. # Default as no chibios efl config
  403. EEPROM_DRIVER ?= transient
  404. endif
  405. ifneq ($(findstring STM32G431, $(MCU)),)
  406. # Cortex version
  407. MCU = cortex-m4
  408. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  409. ARMV = 7
  410. ## chip/board settings
  411. # - the next two should match the directories in
  412. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  413. # OR
  414. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  415. MCU_FAMILY = STM32
  416. MCU_SERIES = STM32G4xx
  417. # Linker script to use
  418. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  419. # or <keyboard_dir>/ld/
  420. MCU_LDSCRIPT ?= STM32G431xB
  421. # Startup code to use
  422. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  423. MCU_STARTUP ?= stm32g4xx
  424. # Board: it should exist either in <chibios>/os/hal/boards/,
  425. # <keyboard_dir>/boards/, or drivers/boards/
  426. BOARD ?= GENERIC_STM32_G431XB
  427. USE_FPU ?= yes
  428. # UF2 settings
  429. UF2_FAMILY ?= STM32G4
  430. # Bootloader address for STM32 DFU
  431. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  432. endif
  433. ifneq ($(findstring STM32G474, $(MCU)),)
  434. # Cortex version
  435. MCU = cortex-m4
  436. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  437. ARMV = 7
  438. ## chip/board settings
  439. # - the next two should match the directories in
  440. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  441. # OR
  442. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  443. MCU_FAMILY = STM32
  444. MCU_SERIES = STM32G4xx
  445. # Linker script to use
  446. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  447. # or <keyboard_dir>/ld/
  448. MCU_LDSCRIPT ?= STM32G474xE
  449. # Startup code to use
  450. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  451. MCU_STARTUP ?= stm32g4xx
  452. # Board: it should exist either in <chibios>/os/hal/boards/,
  453. # <keyboard_dir>/boards/, or drivers/boards/
  454. BOARD ?= GENERIC_STM32_G474XE
  455. USE_FPU ?= yes
  456. # UF2 settings
  457. UF2_FAMILY ?= STM32G4
  458. # Bootloader address for STM32 DFU
  459. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  460. endif
  461. ifneq (,$(filter $(MCU),STM32L432 STM32L442))
  462. # Cortex version
  463. MCU = cortex-m4
  464. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  465. ARMV = 7
  466. ## chip/board settings
  467. # - the next two should match the directories in
  468. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  469. # OR
  470. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  471. MCU_FAMILY = STM32
  472. MCU_SERIES = STM32L4xx
  473. # Linker script to use
  474. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  475. # or <keyboard_dir>/ld/
  476. MCU_LDSCRIPT ?= STM32L432xC
  477. # Startup code to use
  478. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  479. MCU_STARTUP ?= stm32l4xx
  480. # Board: it should exist either in <chibios>/os/hal/boards/,
  481. # <keyboard_dir>/boards/, or drivers/boards/
  482. BOARD ?= GENERIC_STM32_L432XC
  483. PLATFORM_NAME ?= platform_l432
  484. USE_FPU ?= yes
  485. # UF2 settings
  486. UF2_FAMILY ?= STM32L4
  487. # Bootloader address for STM32 DFU
  488. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  489. endif
  490. ifneq (,$(filter $(MCU),STM32L433 STM32L443))
  491. # Cortex version
  492. MCU = cortex-m4
  493. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  494. ARMV = 7
  495. ## chip/board settings
  496. # - the next two should match the directories in
  497. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  498. # OR
  499. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  500. MCU_FAMILY = STM32
  501. MCU_SERIES = STM32L4xx
  502. # Linker script to use
  503. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  504. # or <keyboard_dir>/ld/
  505. MCU_LDSCRIPT ?= STM32L432xC
  506. # Startup code to use
  507. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  508. MCU_STARTUP ?= stm32l4xx
  509. # Board: it should exist either in <chibios>/os/hal/boards/,
  510. # <keyboard_dir>/boards/, or drivers/boards/
  511. BOARD ?= GENERIC_STM32_L433XC
  512. PLATFORM_NAME ?= platform_l432
  513. USE_FPU ?= yes
  514. # UF2 settings
  515. UF2_FAMILY ?= STM32L4
  516. # Bootloader address for STM32 DFU
  517. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  518. endif
  519. ifneq (,$(filter $(MCU),STM32L412 STM32L422))
  520. # Cortex version
  521. MCU = cortex-m4
  522. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  523. ARMV = 7
  524. ## chip/board settings
  525. # - the next two should match the directories in
  526. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  527. # OR
  528. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  529. MCU_FAMILY = STM32
  530. MCU_SERIES = STM32L4xx
  531. # Linker script to use
  532. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  533. # or <keyboard_dir>/ld/
  534. MCU_LDSCRIPT ?= STM32L412xB
  535. # Startup code to use
  536. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  537. MCU_STARTUP ?= stm32l4xx
  538. # Board: it should exist either in <chibios>/os/hal/boards/,
  539. # <keyboard_dir>/boards/, or drivers/boards/
  540. BOARD ?= GENERIC_STM32_L412XB
  541. PLATFORM_NAME ?= platform_l412_l422
  542. USE_FPU ?= yes
  543. # UF2 settings
  544. UF2_FAMILY ?= STM32L4
  545. # Bootloader address for STM32 DFU
  546. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  547. endif
  548. ifneq ($(findstring WB32F3G71, $(MCU)),)
  549. # Cortex version
  550. MCU = cortex-m3
  551. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  552. ARMV = 7
  553. ## chip/board settings
  554. # - the next two should match the directories in
  555. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  556. # OR
  557. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  558. MCU_FAMILY = WB32
  559. MCU_SERIES = WB32F3G71xx
  560. # Linker script to use
  561. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  562. # or <keyboard_dir>/ld/
  563. MCU_LDSCRIPT ?= WB32F3G71x9
  564. # Startup code to use
  565. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  566. MCU_STARTUP ?= wb32f3g71xx
  567. # Board: it should exist either in <chibios>/os/hal/boards/,
  568. # <keyboard_dir>/boards/, or drivers/boards/
  569. BOARD ?= GENERIC_WB32_F3G71XX
  570. USE_FPU ?= no
  571. # Bootloader address for WB32 DFU
  572. WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
  573. endif
  574. ifneq ($(findstring WB32FQ95, $(MCU)),)
  575. # Cortex version
  576. MCU = cortex-m3
  577. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  578. ARMV = 7
  579. ## chip/board settings
  580. # - the next two should match the directories in
  581. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  582. # OR
  583. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  584. MCU_FAMILY = WB32
  585. MCU_SERIES = WB32FQ95xx
  586. # Linker script to use
  587. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  588. # or <keyboard_dir>/ld/
  589. MCU_LDSCRIPT ?= WB32FQ95xB
  590. # Startup code to use
  591. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  592. MCU_STARTUP ?= wb32fq95xx
  593. # Board: it should exist either in <chibios>/os/hal/boards/,
  594. # <keyboard_dir>/boards/, or drivers/boards/
  595. BOARD ?= GENERIC_WB32_FQ95XX
  596. USE_FPU ?= no
  597. # Bootloader address for WB32 DFU
  598. WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
  599. endif
  600. ifneq ($(findstring GD32VF103, $(MCU)),)
  601. # RISC-V
  602. MCU = risc-v
  603. # RISC-V extensions and abi configuration
  604. MCU_ARCH = rv32imac
  605. MCU_ABI = ilp32
  606. MCU_CMODEL = medlow
  607. ## chip/board settings
  608. # - the next two should match the directories in
  609. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  610. # OR
  611. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  612. MCU_PORT_NAME = GD
  613. MCU_FAMILY = GD32V
  614. MCU_SERIES = GD32VF103
  615. # Linker script to use
  616. # - it should exist either in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/
  617. # or <keyboard_dir>/ld/
  618. MCU_LDSCRIPT ?= GD32VF103xB
  619. # Startup code to use
  620. # - it should exist in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/mk/
  621. MCU_STARTUP ?= gd32vf103
  622. # Board: it should exist either in <chibios>/os/hal/boards/,
  623. # <keyboard_dir>/boards/, or drivers/boards/
  624. BOARD ?= SIPEED_LONGAN_NANO
  625. USE_FPU ?= no
  626. endif
  627. ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))
  628. PROTOCOL = LUFA
  629. # Processor frequency.
  630. # This will define a symbol, F_CPU, in all source code files equal to the
  631. # processor frequency in Hz. You can then use this symbol in your source code to
  632. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  633. # automatically to create a 32-bit value in your source code.
  634. #
  635. # This will be an integer division of F_USB below, as it is sourced by
  636. # F_USB after it has run through any CPU prescalers. Note that this value
  637. # does not *change* the processor frequency - it should merely be updated to
  638. # reflect the processor speed set externally so that the code can use accurate
  639. # software delays.
  640. F_CPU ?= 16000000
  641. # LUFA specific
  642. #
  643. # Target architecture (see library "Board Types" documentation).
  644. ARCH = AVR8
  645. # Input clock frequency.
  646. # This will define a symbol, F_USB, in all source code files equal to the
  647. # input clock frequency (before any prescaling is performed) in Hz. This value may
  648. # differ from F_CPU if prescaling is used on the latter, and is required as the
  649. # raw input clock is fed directly to the PLL sections of the AVR for high speed
  650. # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
  651. # at the end, this will be done automatically to create a 32-bit value in your
  652. # source code.
  653. #
  654. # If no clock division is performed on the input clock inside the AVR (via the
  655. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
  656. F_USB ?= $(F_CPU)
  657. # Interrupt driven control endpoint task
  658. ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
  659. OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
  660. endif
  661. ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2))
  662. NO_I2C = yes
  663. endif
  664. endif
  665. ifneq (,$(filter $(MCU),atmega32a))
  666. # MCU name for avrdude
  667. AVRDUDE_MCU = m32
  668. PROTOCOL = VUSB
  669. # Processor frequency.
  670. # This will define a symbol, F_CPU, in all source code files equal to the
  671. # processor frequency in Hz. You can then use this symbol in your source code to
  672. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  673. # automatically to create a 32-bit value in your source code.
  674. F_CPU ?= 12000000
  675. endif
  676. ifneq (,$(filter $(MCU),atmega328p))
  677. # MCU name for avrdude
  678. AVRDUDE_MCU = m328p
  679. PROTOCOL = VUSB
  680. # Processor frequency.
  681. # This will define a symbol, F_CPU, in all source code files equal to the
  682. # processor frequency in Hz. You can then use this symbol in your source code to
  683. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  684. # automatically to create a 32-bit value in your source code.
  685. F_CPU ?= 16000000
  686. endif
  687. ifneq (,$(filter $(MCU),atmega328))
  688. # MCU name for avrdude
  689. AVRDUDE_MCU = m328
  690. PROTOCOL = VUSB
  691. # Processor frequency.
  692. # This will define a symbol, F_CPU, in all source code files equal to the
  693. # processor frequency in Hz. You can then use this symbol in your source code to
  694. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  695. # automatically to create a 32-bit value in your source code.
  696. F_CPU ?= 16000000
  697. endif
  698. ifneq (,$(filter $(MCU),attiny85))
  699. PROTOCOL = VUSB
  700. # Processor frequency.
  701. # This will define a symbol, F_CPU, in all source code files equal to the
  702. # processor frequency in Hz. You can then use this symbol in your source code to
  703. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  704. # automatically to create a 32-bit value in your source code.
  705. F_CPU ?= 16500000
  706. endif