mcu_selection.mk 23 KB

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