forked from am32-firmware/AM32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
l431makefile.mk
56 lines (42 loc) · 1.41 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
50
51
52
53
54
55
56
MCU := L431
PART := STM32L431xx
TARGETS_$(MCU) := $(call get_targets,$(MCU))
HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(call lc,$(MCU))
MCU_$(MCU) := -mcpu=cortex-m4 -mthumb
LDSCRIPT_$(MCU) := $(HAL_FOLDER_$(MCU))/ldscript.ld
SRC_BASE_DIR_$(MCU) := \
$(HAL_FOLDER_$(MCU))/Startup/gcc \
$(HAL_FOLDER_$(MCU))/Drivers/STM32L4xx_HAL_Driver/Src
SRC_DIR_$(MCU) := \
$(SRC_BASE_DIR_$(MCU)) \
$(HAL_FOLDER_$(MCU))/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) += \
-D$(PART) \
-DHSE_STARTUP_TIMEOUT=100 \
-DLSE_STARTUP_TIMEOUT=5000 \
-DDATA_CACHE_ENABLE=1 \
-DINSTRUCTION_CACHE_ENABLE=0 \
-DVDD_VALUE=3300 \
-DLSI_VALUE=32000 \
-DHSI_VALUE=16000000 \
-DUSE_FULL_LL_DRIVER \
-DPREFETCH_ENABLE=1 \
-mfloat-abi=hard
SRC_$(MCU) := $(foreach dir,$(SRC_DIR_$(MCU)),$(wildcard $(dir)/*.[cs]))
# optional CAN support
CFLAGS_CAN_$(MCU) = \
-ISrc/DroneCAN \
-ISrc/DroneCAN/libcanard \
-ISrc/DroneCAN/libcanard/drivers/stm32 \
-ISrc/DroneCAN/dsdl_generated/include
SRC_DIR_CAN_$(MCU) = Src/DroneCAN \
Src/DroneCAN/dsdl_generated/src \
Src/DroneCAN/libcanard \
Src/DroneCAN/libcanard/drivers/stm32
SRC_CAN_$(MCU) := $(foreach dir,$(SRC_DIR_CAN_$(MCU)),$(wildcard $(dir)/*.[cs]))
LDSCRIPT_CAN_$(MCU) := $(HAL_FOLDER_$(MCU))/ldscript_CAN.ld