-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathl431makefile.mk
49 lines (40 loc) · 1.42 KB
/
l431makefile.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
MCU := L431
PART := STM32L431xx
HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(call lc,$(MCU))
MCU_$(MCU) := -mcpu=cortex-m4 -mthumb
LDSCRIPT_$(MCU) := $(wildcard $(HAL_FOLDER_$(MCU))/*.ld)
SRC_BASE_DIR_$(MCU) := \
$(HAL_FOLDER_$(MCU))/Startup \
$(HAL_FOLDER_$(MCU))/Drivers/STM32L4xx_HAL_Driver/Src
CFLAGS_$(MCU) := \
-I$(HAL_FOLDER_$(MCU))/Inc \
-I$(HAL_FOLDER_$(MCU))/Drivers/STM32L4xx_HAL_Driver/Inc \
-I$(HAL_FOLDER_$(MCU))/Drivers/CMSIS/Include \
-I$(HAL_FOLDER_$(MCU))/Drivers/CMSIS/Device/ST/STM32L4xx/Include
CFLAGS_$(MCU) += \
-DHSE_VALUE=8000000 \
-D$(PART) \
-DMCU_$(MCU) \
-DHSE_STARTUP_TIMEOUT=100 \
-DLSE_STARTUP_TIMEOUT=5000 \
-DLSE_VALUE=32768 \
-DDATA_CACHE_ENABLE=1 \
-DINSTRUCTION_CACHE_ENABLE=0 \
-DVDD_VALUE=3300 \
-DLSI_VALUE=32000 \
-DHSI_VALUE=16000000 \
-DUSE_FULL_LL_DRIVER \
-DPREFETCH_ENABLE=1
SRC_$(MCU)_BL := $(foreach dir,$(SRC_BASE_DIR_$(MCU)),$(wildcard $(dir)/*.[cs])) \
$(wildcard $(HAL_FOLDER_$(MCU))/Src/*.c)
# additional CFLAGS and source for DroneCAN
CFLAGS_DRONECAN_$(MCU) += \
-Ibootloader/DroneCAN \
-Ibootloader/DroneCAN/libcanard \
-Ibootloader/DroneCAN/libcanard/drivers/stm32 \
-Ibootloader/DroneCAN/dsdl_generated/include
SRC_DIR_DRONECAN_$(MCU) += bootloader/DroneCAN \
bootloader/DroneCAN/dsdl_generated/src \
bootloader/DroneCAN/libcanard \
bootloader/DroneCAN/libcanard/drivers/stm32
SRC_DRONECAN_$(MCU) := $(foreach dir,$(SRC_DIR_DRONECAN_$(MCU)),$(wildcard $(dir)/*.[cs]))