mcu_selection.mk 25 KB

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