Makefile.hal 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. # Processor frequency (external freq-in)
  2. ifndef F_CPU
  3. F_CPU = 7372800
  4. endif
  5. HALPATH = $(FIRMWAREPATH)/hal
  6. VPATH += :$(HALPATH)
  7. #Default stuff
  8. EXTRAINCDIRS += $(HALPATH)
  9. #Manually have to update these lists...
  10. PLATFORM_LIST = CW308_CC2538 CW301_AVR CW303 CW304 CW308_MEGARF CW308_SAM4L \
  11. CW308_STM32F0 CW308_STM32F1 CW308_STM32F2 CW308_STM32F3 CW308_STM32F4 CW308_K24F \
  12. CW308_NRF52 CW308_AURIX CW308_SAML11 CW308_EFM32TG11B CWLITEARM CWLITEXMEGA CWNANO CW308_K82F \
  13. CW308_PSOC62 CW308_IMXRT1062 CW308_FE310 CW308_EFR32MG21A CW308_EFM32GG11 CW308_STM32L5
  14. define KNOWN_PLATFORMS
  15. +-------------------------------------------------------+
  16. | PLATFORM | DESCRIPTION |
  17. +=======================================================+
  18. | AVR/XMEGA Targets (8-Bit RISC) |
  19. +=======================================================+
  20. +-------------------------------------------------------+
  21. | CWLITEXMEGA | CW-Lite XMEGA (Alias for CW303) |
  22. +-------------------------------------------------------+
  23. | CW301_AVR | Multi-Target Board, AVR Target |
  24. +-------------------------------------------------------+
  25. | CW303 | XMEGA Target (CWLite), Also works |
  26. | | for CW308T-XMEGA |
  27. +-------------------------------------------------------+
  28. | CW304 | ATMega328P (NOTDUINO), Also works |
  29. | | for CW308T-AVR |
  30. +-------------------------------------------------------+
  31. | CW308_MEGARF | ATMega2564RFR2 Target for CW308T |
  32. +-------------------------------------------------------+
  33. +=======================================================+
  34. + ARM Cortex-M Targets (Generic) |
  35. +=======================================================+
  36. +-------------------------------------------------------+
  37. | CWLITEARM | CW-Lite Arm (Alias for CW308_STM32F3) |
  38. +-------------------------------------------------------+
  39. | CWNANO | CW-Lite Nano (STM32F0_NANO) |
  40. +-------------------------------------------------------+
  41. | CW308_STM32F0 | CW308T-STM32F0 (ST Micro STM32F0) |
  42. +-------------------------------------------------------+
  43. | CW308_STM32F1 | CW308T-STM32F0 (ST Micro STM32F1) |
  44. +-------------------------------------------------------+
  45. | CW308_STM32F2 | CW308T-STM32F2 (ST Micro STM32F2) |
  46. +-------------------------------------------------------+
  47. | CW308_STM32F3 | CW308T-STM32F3 (ST Micro STM32F3) |
  48. +-------------------------------------------------------+
  49. | CW308_STM32F4 | CW308T-STM32F4 (ST Micro STM32F405) |
  50. +-------------------------------------------------------+
  51. +=======================================================+
  52. + ARM Cortex-M Targets (Support CRYPTO_TARGET=HWAES) |
  53. +=======================================================+
  54. +-------------------------------------------------------+
  55. | CW308_CC2538 | CW308T-CC2538 (TI CC2538) |
  56. +-------------------------------------------------------+
  57. | CW308_ | CW308T-EFM32GG11 |
  58. | EFM32GG11 | (Silicon Labs Giant Gecko) |
  59. +-------------------------------------------------------+
  60. | CW308_ | CW-Lite EFM32TG11B |
  61. | EFM32TG11B | (Silicon Labs Tiny Geko) |
  62. +-------------------------------------------------------+
  63. | CW308_ | CW308T-EFR32MG21 (A version without |
  64. | EFR32MG21A | 'secure vault') |
  65. +-------------------------------------------------------+
  66. | CW308_ | CW308T-IMXRT1062 (iMX RT1062) |
  67. | IMXRT1062 | NXP "Cross-Over" Microcontroller |
  68. +-------------------------------------------------------+
  69. | CW308_K24F | CW308T-K24F (NXP Kinetis K24F) |
  70. +-------------------------------------------------------+
  71. | CW308_K82F | CW308T-K82F (NXP Kinetis K82F) |
  72. +-------------------------------------------------------+
  73. | CW308_LPC55S6X| CW308T-LPC55S69 (NXP LPC55S69) |
  74. +-------------------------------------------------------+
  75. | CW308_NRF52 | CW308T-NRF52840 (Nordic Semi) |
  76. +-------------------------------------------------------+
  77. | CW308_PSOC62 | CW308T-PSOC62 (Cypress PSOC 62) |
  78. +-------------------------------------------------------+
  79. | CW308_SAM4L | CW308T-SAM4L (Atmel SAM4L) |
  80. +-------------------------------------------------------+
  81. | CW308_SAML11 | CW-Lite SAML11 (Atmel SAML11) |
  82. +-------------------------------------------------------+
  83. | CW308_STM32F2 | CW308T-STM32F2HWC (ST Micro STM32F215)|
  84. +-------------------------------------------------------+
  85. | CW308_STM32F4 | CW308T-STM32F4HWC (ST Micro STM32F415)|
  86. +-------------------------------------------------------+
  87. | CW308_STM32L4 | CW308T-STM32L4 (ST Micro STM32L443) |
  88. +-------------------------------------------------------+
  89. | CW308_STM32L5 | CW308T-STM32L5HWC (ST Micro STM32L562)|
  90. +-------------------------------------------------------+
  91. +=======================================================+
  92. + Other 32-bit Architecture |
  93. +=======================================================+
  94. +-------------------------------------------------------+
  95. | CW308_AURIX | CW-Lite AURIX (Infineon TC233A) |
  96. +-------------------------------------------------------+
  97. | CW308_FE310 | CW308T-FE310-G002 (RISC-V) |
  98. +-------------------------------------------------------+
  99. | CW308_ | CW308T-MPC5676R (NXP MPC5676R) |
  100. | MPC5676R | |
  101. +---------------|---------------------------------------+
  102. Options to define platform:
  103. (1) Run make with PLATFORM specified as follows:
  104. make PLATFORM=CW304
  105. (2) Save a file called Makefile.platform with contents:
  106. PLATFORM=CW304
  107. endef
  108. PLTNAME = Unknown Platform
  109. ifeq ($(DEMO),SECCAN)
  110. CFLAGS += -DSECCAN
  111. endif
  112. ifeq ($(MCU_CLK), INT)
  113. CFLAGS += -DUSE_INTERNAL_CLK
  114. endif
  115. ifeq ($(PLATFORM),CW301_AVR)
  116. MCU = atmega328
  117. HAL = avr
  118. PLTNAME = Multi-Target Board, AVR Target
  119. else ifeq ($(PLATFORM),CW301_XMEGA)
  120. MCU = atxmega16a4
  121. HAL = xmega
  122. PLTNAME = Multi-Target Board, XMEGA Target
  123. else ifeq ($(PLATFORM),CWAVRCAN)
  124. MCU = at90can128
  125. HAL = avr
  126. PLTNAME = AT90CAN128 Target
  127. else ifeq ($(PLATFORM),CW303)
  128. #d4 not officially supported, by has same reg map
  129. MCU = atxmega128d3
  130. HAL = xmega
  131. PLTNAME = CW-Lite XMEGA
  132. else ifeq ($(PLATFORM),CWLITEXMEGA)
  133. #d4 not officially supported, by has same reg map
  134. MCU = atxmega128d3
  135. HAL = xmega
  136. PLTNAME = CW-Lite XMEGA
  137. else ifeq ($(PLATFORM),CW304)
  138. MCU = atmega328
  139. HAL = avr
  140. PLTNAME = CW-Lite NOTDUINO
  141. else ifeq ($(PLATFORM),CW308_MEGARF)
  142. MCU = atmega128rfa1
  143. # MCU = atmega2564rfr2
  144. HAL = avr
  145. PLTNAME = CW308T: ATMegaRF Target
  146. else ifeq ($(PLATFORM),CW308_SAM4L)
  147. HAL = sam4l
  148. PLTNAME = CW308T: SAM4L Target
  149. else ifeq ($(PLATFORM),CW308_STM32F0)
  150. HAL = stm32f0
  151. PLTNAME = CW308T: STM32F0 Target
  152. else ifeq ($(PLATFORM),CW308_STM32F1)
  153. HAL = stm32f1
  154. PLTNAME = CW308T: STM32F1 Target
  155. else ifeq ($(PLATFORM),CW308_STM32F2)
  156. HAL = stm32f2
  157. PLTNAME = CW308T: STM32F2 Target
  158. else ifeq ($(PLATFORM),CW308_STM32F3)
  159. HAL = stm32f3
  160. PLTNAME = CW308T: STM32F3 Target
  161. else ifeq ($(PLATFORM),CWLITEARM)
  162. HAL = stm32f3
  163. PLTNAME = CW-Lite Arm \(STM32F3\)
  164. else ifeq ($(PLATFORM),CW308_STM32F4)
  165. HAL = stm32f4
  166. PLTNAME = CW308T: STM32F4 Target
  167. else ifeq ($(PLATFORM),CW308_CC2538)
  168. HAL = cc2538
  169. PLTNAME = CW308T: CC2538 Target
  170. else ifeq ($(PLATFORM),CW308_K24F)
  171. HAL = k24f
  172. PLTNAME = CW308T: Kinetis K24F Target
  173. else ifeq ($(PLATFORM),CW308_K82F)
  174. HAL = k82f
  175. PLTNAME = CW308T: Kinetis MK82F Target
  176. else ifeq ($(PLATFORM),CW308_NRF52)
  177. HAL = nrf52840
  178. PLTNAME = NRF52840 Target
  179. else ifeq ($(PLATFORM),CWNANO)
  180. HAL = stm32f0_nano
  181. PLTNAME = CWNANO Built-in Target (STM32F030)
  182. else ifeq ($(PLATFORM),CW308_AURIX)
  183. HAL = aurix
  184. PLTNAME = CW308T: AURIX TC233A Target
  185. else ifeq ($(PLATFORM),CW308_SAML11)
  186. HAL = saml11
  187. PLTNAME = CW308T: SAML11 Target
  188. else ifeq ($(PLATFORM),CW308_EFM32TG11B)
  189. HAL = efm32tg11b
  190. PLTNAME = CW308T: EFM32TG11B Target
  191. else ifeq ($(PLATFORM),CW308_LPC55S6X)
  192. HAL = lpc55s6x
  193. PLTNAME = CW308T: LPC55S6X Target
  194. else ifeq ($(PLATFORM),CW308_PSOC62)
  195. HAL = psoc62
  196. PLTNAME = CW308T: PSOC62 Target
  197. else ifeq ($(PLATFORM),CW308_IMXRT1062)
  198. HAL = imxrt1062
  199. PLTNAME = CW308T: IMXRT1062 Target
  200. else ifeq ($(PLATFORM),CW308_FE310)
  201. HAL = fe310
  202. PLTNAME = CW308T: FE310-G002 Target
  203. else ifeq ($(PLATFORM),CW308_EFR32MG21A)
  204. HAL = efr32mg21a
  205. PLTNAME = CW308T: EFR32MG21A Target
  206. else ifeq ($(PLATFORM),CW308_EFM32GG11)
  207. HAL = efm32gg11
  208. PLTNAME = CW308T: EFM32GG11 Target
  209. else ifeq ($(PLATFORM),CW308_STM32L4)
  210. HAL = stm32l4
  211. PLTNAME = CW308T: STM32L4 Target
  212. else ifeq ($(PLATFORM),CW308_STM32L5)
  213. HAL = stm32l5
  214. PLTNAME = CW308T: STM32L5 Target
  215. else ifeq ($(PLATFORM),CW308_RX65N)
  216. HAL = rx65n
  217. PLTNAME = CW308T: RX65N
  218. else ifeq ($(PLATFORM),CW308_MPC5676R)
  219. HAL = mpc5676r
  220. else
  221. $(error Invalid or empty PLATFORM: $(PLATFORM). Known platforms: $(KNOWN_PLATFORMS))
  222. endif
  223. include $(HALPATH)/$(HAL)/Makefile.$(HAL)
  224. CDEFS += -DHAL_TYPE=HAL_$(HAL) -DPLATFORM=$(PLATFORM)