mcu_selection.mk 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  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. # Revert to legacy wear-leveling driver until ChibiOS's EFL driver is fixed with 128kB and 384kB variants.
  289. EEPROM_DRIVER ?= wear_leveling
  290. WEAR_LEVELING_DRIVER ?= legacy
  291. endif
  292. ifneq ($(findstring STM32F405, $(MCU)),)
  293. # Cortex version
  294. MCU = cortex-m4
  295. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  296. ARMV = 7
  297. ## chip/board settings
  298. # - the next two should match the directories in
  299. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  300. # OR
  301. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  302. MCU_FAMILY = STM32
  303. MCU_SERIES = STM32F4xx
  304. # Linker script to use
  305. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  306. # or <keyboard_dir>/ld/
  307. MCU_LDSCRIPT ?= STM32F405xG
  308. # Startup code to use
  309. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  310. MCU_STARTUP ?= stm32f4xx
  311. # Board: it should exist either in <chibios>/os/hal/boards/,
  312. # <keyboard_dir>/boards/, or drivers/boards/
  313. BOARD ?= GENERIC_STM32_F405XG
  314. USE_FPU ?= yes
  315. # UF2 settings
  316. UF2_FAMILY ?= STM32F4
  317. # Bootloader address for STM32 DFU
  318. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  319. endif
  320. ifneq ($(findstring STM32F407, $(MCU)),)
  321. # Cortex version
  322. MCU = cortex-m4
  323. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  324. ARMV = 7
  325. ## chip/board settings
  326. # - the next two should match the directories in
  327. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  328. # OR
  329. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  330. MCU_FAMILY = STM32
  331. MCU_SERIES = STM32F4xx
  332. # Linker script to use
  333. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  334. # or <keyboard_dir>/ld/
  335. MCU_LDSCRIPT ?= STM32F407xE
  336. # Startup code to use
  337. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  338. MCU_STARTUP ?= stm32f4xx
  339. # Board: it should exist either in <chibios>/os/hal/boards/,
  340. # <keyboard_dir>/boards/, or drivers/boards/
  341. BOARD ?= GENERIC_STM32_F407XE
  342. USE_FPU ?= yes
  343. # UF2 settings
  344. UF2_FAMILY ?= STM32F4
  345. # Bootloader address for STM32 DFU
  346. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  347. endif
  348. ifneq ($(findstring STM32F411, $(MCU)),)
  349. # Cortex version
  350. MCU = cortex-m4
  351. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  352. ARMV = 7
  353. ## chip/board settings
  354. # - the next two should match the directories in
  355. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  356. # OR
  357. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  358. MCU_FAMILY = STM32
  359. MCU_SERIES = STM32F4xx
  360. # Linker script to use
  361. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  362. # or <keyboard_dir>/ld/
  363. ifeq ($(strip $(BOOTLOADER)), tinyuf2)
  364. MCU_LDSCRIPT ?= STM32F411xE_tinyuf2
  365. else
  366. MCU_LDSCRIPT ?= STM32F411xE
  367. endif
  368. # Startup code to use
  369. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  370. MCU_STARTUP ?= stm32f4xx
  371. # Board: it should exist either in <chibios>/os/hal/boards/,
  372. # <keyboard_dir>/boards/, or drivers/boards/
  373. BOARD ?= GENERIC_STM32_F411XE
  374. USE_FPU ?= yes
  375. # UF2 settings
  376. UF2_FAMILY ?= STM32F4
  377. # Bootloader address for STM32 DFU
  378. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  379. endif
  380. ifneq ($(findstring STM32F446, $(MCU)),)
  381. # Cortex version
  382. MCU = cortex-m4
  383. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  384. ARMV = 7
  385. ## chip/board settings
  386. # - the next two should match the directories in
  387. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  388. # OR
  389. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  390. MCU_FAMILY = STM32
  391. MCU_SERIES = STM32F4xx
  392. # Linker script to use
  393. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  394. # or <keyboard_dir>/ld/
  395. MCU_LDSCRIPT ?= STM32F446xE
  396. # Startup code to use
  397. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  398. MCU_STARTUP ?= stm32f4xx
  399. # Board: it should exist either in <chibios>/os/hal/boards/,
  400. # <keyboard_dir>/boards/, or drivers/boards/
  401. BOARD ?= GENERIC_STM32_F446XE
  402. USE_FPU ?= yes
  403. # Bootloader address for STM32 DFU
  404. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  405. # Default as no chibios efl config
  406. EEPROM_DRIVER ?= transient
  407. endif
  408. ifneq ($(findstring STM32G431, $(MCU)),)
  409. # Cortex version
  410. MCU = cortex-m4
  411. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  412. ARMV = 7
  413. ## chip/board settings
  414. # - the next two should match the directories in
  415. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  416. # OR
  417. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  418. MCU_FAMILY = STM32
  419. MCU_SERIES = STM32G4xx
  420. # Linker script to use
  421. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  422. # or <keyboard_dir>/ld/
  423. MCU_LDSCRIPT ?= STM32G431xB
  424. # Startup code to use
  425. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  426. MCU_STARTUP ?= stm32g4xx
  427. # Board: it should exist either in <chibios>/os/hal/boards/,
  428. # <keyboard_dir>/boards/, or drivers/boards/
  429. BOARD ?= GENERIC_STM32_G431XB
  430. USE_FPU ?= yes
  431. # UF2 settings
  432. UF2_FAMILY ?= STM32G4
  433. # Bootloader address for STM32 DFU
  434. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  435. endif
  436. ifneq ($(findstring STM32G474, $(MCU)),)
  437. # Cortex version
  438. MCU = cortex-m4
  439. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  440. ARMV = 7
  441. ## chip/board settings
  442. # - the next two should match the directories in
  443. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  444. # OR
  445. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  446. MCU_FAMILY = STM32
  447. MCU_SERIES = STM32G4xx
  448. # Linker script to use
  449. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  450. # or <keyboard_dir>/ld/
  451. MCU_LDSCRIPT ?= STM32G474xE
  452. # Startup code to use
  453. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  454. MCU_STARTUP ?= stm32g4xx
  455. # Board: it should exist either in <chibios>/os/hal/boards/,
  456. # <keyboard_dir>/boards/, or drivers/boards/
  457. BOARD ?= GENERIC_STM32_G474XE
  458. USE_FPU ?= yes
  459. # UF2 settings
  460. UF2_FAMILY ?= STM32G4
  461. # Bootloader address for STM32 DFU
  462. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  463. endif
  464. ifneq (,$(filter $(MCU),STM32L432 STM32L442))
  465. # Cortex version
  466. MCU = cortex-m4
  467. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  468. ARMV = 7
  469. ## chip/board settings
  470. # - the next two should match the directories in
  471. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  472. # OR
  473. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  474. MCU_FAMILY = STM32
  475. MCU_SERIES = STM32L4xx
  476. # Linker script to use
  477. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  478. # or <keyboard_dir>/ld/
  479. MCU_LDSCRIPT ?= STM32L432xC
  480. # Startup code to use
  481. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  482. MCU_STARTUP ?= stm32l4xx
  483. # Board: it should exist either in <chibios>/os/hal/boards/,
  484. # <keyboard_dir>/boards/, or drivers/boards/
  485. BOARD ?= GENERIC_STM32_L432XC
  486. PLATFORM_NAME ?= platform_l432
  487. USE_FPU ?= yes
  488. # UF2 settings
  489. UF2_FAMILY ?= STM32L4
  490. # Bootloader address for STM32 DFU
  491. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  492. endif
  493. ifneq (,$(filter $(MCU),STM32L433 STM32L443))
  494. # Cortex version
  495. MCU = cortex-m4
  496. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  497. ARMV = 7
  498. ## chip/board settings
  499. # - the next two should match the directories in
  500. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  501. # OR
  502. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  503. MCU_FAMILY = STM32
  504. MCU_SERIES = STM32L4xx
  505. # Linker script to use
  506. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  507. # or <keyboard_dir>/ld/
  508. MCU_LDSCRIPT ?= STM32L432xC
  509. # Startup code to use
  510. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  511. MCU_STARTUP ?= stm32l4xx
  512. # Board: it should exist either in <chibios>/os/hal/boards/,
  513. # <keyboard_dir>/boards/, or drivers/boards/
  514. BOARD ?= GENERIC_STM32_L433XC
  515. PLATFORM_NAME ?= platform_l432
  516. USE_FPU ?= yes
  517. # UF2 settings
  518. UF2_FAMILY ?= STM32L4
  519. # Bootloader address for STM32 DFU
  520. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  521. endif
  522. ifneq (,$(filter $(MCU),STM32L412 STM32L422))
  523. # Cortex version
  524. MCU = cortex-m4
  525. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  526. ARMV = 7
  527. ## chip/board settings
  528. # - the next two should match the directories in
  529. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  530. # OR
  531. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  532. MCU_FAMILY = STM32
  533. MCU_SERIES = STM32L4xx
  534. # Linker script to use
  535. # - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
  536. # or <keyboard_dir>/ld/
  537. MCU_LDSCRIPT ?= STM32L412xB
  538. # Startup code to use
  539. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  540. MCU_STARTUP ?= stm32l4xx
  541. # Board: it should exist either in <chibios>/os/hal/boards/,
  542. # <keyboard_dir>/boards/, or drivers/boards/
  543. BOARD ?= GENERIC_STM32_L412XB
  544. PLATFORM_NAME ?= platform_l412_l422
  545. USE_FPU ?= yes
  546. # UF2 settings
  547. UF2_FAMILY ?= STM32L4
  548. # Bootloader address for STM32 DFU
  549. STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000
  550. endif
  551. ifneq ($(findstring WB32F3G71, $(MCU)),)
  552. # Cortex version
  553. MCU = cortex-m3
  554. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  555. ARMV = 7
  556. ## chip/board settings
  557. # - the next two should match the directories in
  558. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  559. # OR
  560. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  561. MCU_FAMILY = WB32
  562. MCU_SERIES = WB32F3G71xx
  563. # Linker script to use
  564. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  565. # or <keyboard_dir>/ld/
  566. MCU_LDSCRIPT ?= WB32F3G71x9
  567. # Startup code to use
  568. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  569. MCU_STARTUP ?= wb32f3g71xx
  570. # Board: it should exist either in <chibios>/os/hal/boards/,
  571. # <keyboard_dir>/boards/, or drivers/boards/
  572. BOARD ?= GENERIC_WB32_F3G71XX
  573. USE_FPU ?= no
  574. # Bootloader address for WB32 DFU
  575. WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
  576. endif
  577. ifneq ($(findstring WB32FQ95, $(MCU)),)
  578. # Cortex version
  579. MCU = cortex-m3
  580. # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
  581. ARMV = 7
  582. ## chip/board settings
  583. # - the next two should match the directories in
  584. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  585. # OR
  586. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  587. MCU_FAMILY = WB32
  588. MCU_SERIES = WB32FQ95xx
  589. # Linker script to use
  590. # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
  591. # or <keyboard_dir>/ld/
  592. MCU_LDSCRIPT ?= WB32FQ95xB
  593. # Startup code to use
  594. # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
  595. MCU_STARTUP ?= wb32fq95xx
  596. # Board: it should exist either in <chibios>/os/hal/boards/,
  597. # <keyboard_dir>/boards/, or drivers/boards/
  598. BOARD ?= GENERIC_WB32_FQ95XX
  599. USE_FPU ?= no
  600. # Bootloader address for WB32 DFU
  601. WB32_BOOTLOADER_ADDRESS ?= 0x1FFFE000
  602. endif
  603. ifneq ($(findstring GD32VF103, $(MCU)),)
  604. # RISC-V
  605. MCU = risc-v
  606. # RISC-V extensions and abi configuration
  607. MCU_ARCH = rv32imac
  608. MCU_ABI = ilp32
  609. MCU_CMODEL = medlow
  610. ## chip/board settings
  611. # - the next two should match the directories in
  612. # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
  613. # OR
  614. # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
  615. MCU_PORT_NAME = GD
  616. MCU_FAMILY = GD32V
  617. MCU_SERIES = GD32VF103
  618. # Linker script to use
  619. # - it should exist either in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/
  620. # or <keyboard_dir>/ld/
  621. MCU_LDSCRIPT ?= GD32VF103xB
  622. # Startup code to use
  623. # - it should exist in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/mk/
  624. MCU_STARTUP ?= gd32vf103
  625. # Board: it should exist either in <chibios>/os/hal/boards/,
  626. # <keyboard_dir>/boards/, or drivers/boards/
  627. BOARD ?= SIPEED_LONGAN_NANO
  628. USE_FPU ?= no
  629. endif
  630. ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))
  631. PROTOCOL = LUFA
  632. # Processor frequency.
  633. # This will define a symbol, F_CPU, in all source code files equal to the
  634. # processor frequency in Hz. You can then use this symbol in your source code to
  635. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  636. # automatically to create a 32-bit value in your source code.
  637. #
  638. # This will be an integer division of F_USB below, as it is sourced by
  639. # F_USB after it has run through any CPU prescalers. Note that this value
  640. # does not *change* the processor frequency - it should merely be updated to
  641. # reflect the processor speed set externally so that the code can use accurate
  642. # software delays.
  643. F_CPU ?= 16000000
  644. # LUFA specific
  645. #
  646. # Target architecture (see library "Board Types" documentation).
  647. ARCH = AVR8
  648. # Input clock frequency.
  649. # This will define a symbol, F_USB, in all source code files equal to the
  650. # input clock frequency (before any prescaling is performed) in Hz. This value may
  651. # differ from F_CPU if prescaling is used on the latter, and is required as the
  652. # raw input clock is fed directly to the PLL sections of the AVR for high speed
  653. # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
  654. # at the end, this will be done automatically to create a 32-bit value in your
  655. # source code.
  656. #
  657. # If no clock division is performed on the input clock inside the AVR (via the
  658. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
  659. F_USB ?= $(F_CPU)
  660. # Interrupt driven control endpoint task
  661. ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
  662. OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
  663. endif
  664. ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2))
  665. NO_I2C = yes
  666. endif
  667. endif
  668. ifneq (,$(filter $(MCU),atmega32a))
  669. # MCU name for avrdude
  670. AVRDUDE_MCU = m32
  671. PROTOCOL = VUSB
  672. # Processor frequency.
  673. # This will define a symbol, F_CPU, in all source code files equal to the
  674. # processor frequency in Hz. You can then use this symbol in your source code to
  675. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  676. # automatically to create a 32-bit value in your source code.
  677. F_CPU ?= 12000000
  678. endif
  679. ifneq (,$(filter $(MCU),atmega328p))
  680. # MCU name for avrdude
  681. AVRDUDE_MCU = m328p
  682. PROTOCOL = VUSB
  683. # Processor frequency.
  684. # This will define a symbol, F_CPU, in all source code files equal to the
  685. # processor frequency in Hz. You can then use this symbol in your source code to
  686. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  687. # automatically to create a 32-bit value in your source code.
  688. F_CPU ?= 16000000
  689. endif
  690. ifneq (,$(filter $(MCU),atmega328))
  691. # MCU name for avrdude
  692. AVRDUDE_MCU = m328
  693. PROTOCOL = VUSB
  694. # Processor frequency.
  695. # This will define a symbol, F_CPU, in all source code files equal to the
  696. # processor frequency in Hz. You can then use this symbol in your source code to
  697. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  698. # automatically to create a 32-bit value in your source code.
  699. F_CPU ?= 16000000
  700. endif
  701. ifneq (,$(filter $(MCU),attiny85))
  702. PROTOCOL = VUSB
  703. # Processor frequency.
  704. # This will define a symbol, F_CPU, in all source code files equal to the
  705. # processor frequency in Hz. You can then use this symbol in your source code to
  706. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  707. # automatically to create a 32-bit value in your source code.
  708. F_CPU ?= 16500000
  709. endif