-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathboards.stm32.mk
173 lines (156 loc) · 7.12 KB
/
boards.stm32.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Instructions:
# 1) add a rule for your board to the bottom of this file
# 2) profit!
LFLAGS_STM32=$(LFLAGS) template_stm32.c -T ld.stm32.basic
# STM32F0 starts up with HSI at 8Mhz
STM32F0_CFLAGS=$(M0_FLAGS) -DSTM32F0 -DLITTLE_BIT=100000 $(LFLAGS_STM32) -lopencm3_stm32f0
# STM32F1 starts up with HSI at 8Mhz
STM32F1_CFLAGS=$(M3_FLAGS) -DSTM32F1 -DLITTLE_BIT=200000 $(LFLAGS_STM32) -lopencm3_stm32f1
# STM32F2 starts up with HSI at 16MHz
STM32F2_CFLAGS=$(M3_FLAGS) -DSTM32F2 -DLITTLE_BIT=400000 $(LFLAGS_STM32) -lopencm3_stm32f2
# STM32F3 starts up with HSI at 8MHz
STM32F3_CFLAGS=$(M4FH_FLAGS) -DSTM32F3 -DLITTLE_BIT=400000 $(LFLAGS_STM32) -lopencm3_stm32f3
# STM32F4 starts up with HSI at 16MHz
STM32F4_CFLAGS=$(M4FH_FLAGS) -DSTM32F4 -DLITTLE_BIT=800000 $(LFLAGS_STM32) -lopencm3_stm32f4
# STM32F7 starts up with HSI at 16MHz
STM32F7_CFLAGS=$(M7SP_FLAGS) -DSTM32F7 -DLITTLE_BIT=800000 $(LFLAGS_STM32) -lopencm3_stm32f7
# STM32L0 starts up with MSI at 2.1Mhz
STM32L0_CFLAGS=$(M0P_FLAGS) -DSTM32L0 -DLITTLE_BIT=50000 $(LFLAGS_STM32) -lopencm3_stm32l0
# STM32L1 starts up with MSI at 4MHz
STM32L1_CFLAGS=$(M3_FLAGS) -DSTM32L1 -DLITTLE_BIT=100000 $(LFLAGS_STM32) -lopencm3_stm32l1
# STM32L4 starts up with MSI at 4MHz
STM32L4_CFLAGS=$(M4FH_FLAGS) -DSTM32L4 -DLITTLE_BIT=100000 $(LFLAGS_STM32) -lopencm3_stm32l4
# STM32G0 starts up with HSI at 16MHz
STM32G0_CFLAGS=$(M0P_FLAGS) -DSTM32G0 -DLITTLE_BIT=400000 $(LFLAGS_STM32) -lopencm3_stm32g0
# STM32G4 starts up with HSI at 16MHz
STM32G4_CFLAGS=$(M4FH_FLAGS) -DSTM32G4 -DLITTLE_BIT=400000 $(LFLAGS_STM32) -lopencm3_stm32g4
# STM32H7 starts up with HSI at 64MHz
STM32H7_CFLAGS=$(M7DP_FLAGS) -DSTM32H7 -DLITTLE_BIT=3200000 $(LFLAGS_STM32) -lopencm3_stm32h7
define RAWMakeBoard
mkdir -p $(OD)/$(7)
$(CC) -DRCC_LED1=RCC_$(1) -DPORT_LED1=$(1) -DPIN_LED1=$(2) \
$(if $(5),-DRCC_LED2=RCC_$(5) -DPORT_LED2=$(5) -DPIN_LED2=$(6),) \
$(3) -o $(OD)/$(7)/$(4)
endef
define MakeBoard
BOARDS_ELF+=$(OD)/$(5)/$(1).elf
BOARDS_BIN+=$(OD)/$(5)/$(1).bin
BOARDS_HEX+=$(OD)/$(5)/$(1).hex
$(OD)/$(5)/$(1).elf: template_stm32.c libopencm3/lib/libopencm3_$(5).a
@echo " $(5) -> Creating $(OD)/$(5)/$(1).elf"
$(call RAWMakeBoard,$(2),$(3),$(4),$(1).elf,$(6),$(7),$(5))
endef
define stm32f0board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F0_CFLAGS),stm32f0,$(4),$(5))
endef
define stm32f1board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F1_CFLAGS),stm32f1,$(4),$(5))
endef
define stm32f2board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F2_CFLAGS),stm32f2,$(4),$(5))
endef
define stm32f3board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F3_CFLAGS),stm32f3,$(4),$(5))
endef
define stm32f4board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F4_CFLAGS),stm32f4,$(4),$(5))
endef
define stm32f7board
$(call MakeBoard,$(1),$(2),$(3),$(STM32F7_CFLAGS),stm32f7,$(4),$(5))
endef
define stm32l0board
$(call MakeBoard,$(1),$(2),$(3),$(STM32L0_CFLAGS),stm32l0,$(4),$(5))
endef
define stm32l1board
$(call MakeBoard,$(1),$(2),$(3),$(STM32L1_CFLAGS),stm32l1,$(4),$(5))
endef
define stm32l4board
$(call MakeBoard,$(1),$(2),$(3),$(STM32L4_CFLAGS),stm32l4,$(4),$(5))
endef
define stm32g0board
$(call MakeBoard,$(1),$(2),$(3),$(STM32G0_CFLAGS),stm32g0)
endef
define stm32g4board
$(call MakeBoard,$(1),$(2),$(3),$(STM32G4_CFLAGS),stm32g4)
endef
define stm32h7board
$(call MakeBoard,$(1),$(2),$(3),$(STM32H7_CFLAGS),stm32h7,$(4),$(5))
endef
# STM32F0 boards
$(eval $(call stm32f0board,stm32f0-discovery,GPIOC,GPIO8))
$(eval $(call stm32f0board,nucleo-f030r8,GPIOA,GPIO5))
$(eval $(call stm32f0board,nucleo-f031k6,GPIOB,GPIO3))
$(eval $(call stm32f0board,nucleo-f042k6,GPIOB,GPIO3))
$(eval $(call stm32f0board,nucleo-f070rb,GPIOA,GPIO5))
$(eval $(call stm32f0board,nucleo-f072rb,GPIOA,GPIO5))
$(eval $(call stm32f0board,nucleo-f091rc,GPIOA,GPIO5))
# STM32F1 boards
$(eval $(call stm32f1board,stm32vldiscovery,GPIOC,GPIO8))
$(eval $(call stm32f1board,olimex-h103,GPIOC,GPIO12))
$(eval $(call stm32f1board,olimex-h107,GPIOC,GPIO6))
$(eval $(call stm32f1board,blackpill,GPIOB,GPIO12))
$(eval $(call stm32f1board,bluepill,GPIOC,GPIO13))
$(eval $(call stm32f1board,nucleo-f103rb,GPIOA,GPIO5))
$(eval $(call stm32f1board,lisa-m-1,GPIOC,GPIO13))
$(eval $(call stm32f1board,lisa-m-2,GPIOA,GPIO8))
$(eval $(call stm32f1board,st-mb525,GPIOC,GPIO6))
$(eval $(call stm32f1board,obldc,GPIOA,GPIO6))
$(eval $(call stm32f1board,obldc-strip,GPIOB,GPIO4))
$(eval $(call stm32f1board,leaflabs-maple,GPIOA,GPIO5))
$(eval $(call stm32f1board,waveshare-open103r,GPIOC,GPIO9))
$(eval $(call stm32f1board,olimex-p103,GPIOC,GPIO12))
# STM32F2 boards
$(eval $(call stm32f2board,jobygps,GPIOC,GPIO3))
# STM32F3 boards
$(eval $(call stm32f3board,stm32f3-discovery,GPIOE,GPIO8,GPIOE,GPIO10))
$(eval $(call stm32f3board,nucleo-f302r8,GPIOB,GPIO13))
$(eval $(call stm32f3board,nucleo-f303k8,GPIOB,GPIO3))
$(eval $(call stm32f3board,nucleo-f303re,GPIOA,GPIO5))
$(eval $(call stm32f3board,nucleo-f334r8,GPIOA,GPIO5))
# STM32F4 boards
# New product code for original f4 discovery board.
$(eval $(call stm32f4board,stm32f407g-disc1,GPIOD,GPIO12))
$(eval $(call stm32f4board,stm32f4discover,GPIOD,GPIO12))
$(eval $(call stm32f4board,nucleo-f411re,GPIOA,GPIO5))
$(eval $(call stm32f4board,nucleo-f401re,GPIOA,GPIO5))
$(eval $(call stm32f4board,stm32f429i-disc1,GPIOG,GPIO13))
$(eval $(call stm32f4board,nucleo-f429zi,GPIOB,GPIO7))
$(eval $(call stm32f4board,nucleo-f410rb,GPIOA,GPIO5))
$(eval $(call stm32f4board,nucleo-f446re,GPIOA,GPIO5))
$(eval $(call stm32f4board,olimex-h405,GPIOC,GPIO12))
$(eval $(call stm32f4board,olimex-p405,GPIOC,GPIO12))
$(eval $(call stm32f4board,olimex-e407,GPIOC,GPIO13))
$(eval $(call stm32f4board,black-stm32f407ve-v2.0,GPIOA,GPIO6))
$(eval $(call stm32f4board,devebox-stm32f407vgt6,GPIOA,GPIO1))
$(eval $(call stm32f4board,weact-studio-minif4x1,GPIOC,GPIO13))
# STM32F7 boards
$(eval $(call stm32f7board,stm32f746g-disco,GPIOI,GPIO1))
$(eval $(call stm32f7board,stm32f769i-disco,GPIOJ,GPIO13))
$(eval $(call stm32f7board,nucleo-f767zi,GPIOB,GPIO0))
# STM32L0 boards
$(eval $(call stm32l0board,stm32l0538-disco,GPIOB,GPIO4))
$(eval $(call stm32l0board,nucleo-l053r8,GPIOA,GPIO5))
$(eval $(call stm32l0board,nucleo-l073rz,GPIOA,GPIO5))
$(eval $(call stm32l0board,nucleo-l011k4,GPIOB,GPIO3))
$(eval $(call stm32l0board,nucleo-l031k6,GPIOB,GPIO3))
# STM32L1 boards
# New product code for original l1 discovery
$(eval $(call stm32l1board,32l152cdiscovery,GPIOB,GPIO6))
$(eval $(call stm32l1board,stm32l-discovery,GPIOB,GPIO6))
$(eval $(call stm32l1board,nucleo-l152re,GPIOA,GPIO5))
$(eval $(call stm32l1board,32l100cdiscovery,GPIOC,GPIO8,GPIOC,GPIO9))
# STM32L4 boards
$(eval $(call stm32l4board,stm32l476g-disco,GPIOE,GPIO8))
$(eval $(call stm32l4board,nucleo-stm32l432kc,GPIOB,GPIO3))
$(eval $(call stm32l4board,nucleo-stm32l452re,GPIOA,GPIO5))
$(eval $(call stm32l4board,nucleo-stm32l476rg,GPIOA,GPIO5))
$(eval $(call stm32l4board,nucleo-l4r5zi,GPIOC,GPIO7,GPIOB,GPIO7))
# STM32G0 boards
$(eval $(call stm32g0board,nucleo-g071rb,GPIOA,GPIO5))
$(eval $(call stm32g0board,stm32g0316-disco,GPIOA,GPIO12))
# STM32G4 boards
$(eval $(call stm32g4board,nucleo-g431rb,GPIOA,GPIO5))
$(eval $(call stm32g4board,nucleo-g491re,GPIOA,GPIO5))
# STM32H7 boards
$(eval $(call stm32h7board,stm32h743zi,GPIOB,GPIO0,GPIOE,GPIO1))
$(eval $(call stm32h7board,nucleo-h723zg,GPIOB,GPIO0,GPIOE,GPIO1))