-
Notifications
You must be signed in to change notification settings - Fork 2
/
stm32f1xx.cmake
52 lines (47 loc) · 1.05 KB
/
stm32f1xx.cmake
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
# Microcontroller memory config
set(FLASH_SIZE "64K" CACHE STRING "microcontroller FLASH size")
set(RAM_SIZE "20K" CACHE STRING "microcontroller RAM size")
#FreeRTOS Port Config
if(ENABLE_FREERTOS)
set(FREERTOS_PORT "GCC_ARM_CM3" CACHE STRING "" FORCE)
set(FREERTOS_HEAPMEM "10240" CACHE STRING "FreeRTOS HEAP Memory in Byte")
endif()
# compiler option
set(TARGET_MCU_COMPILER
-mcpu=cortex-m3
-mthumb
-std=gnu99
-${OPTIM}
-g3
-fmessage-length=0
-fsigned-char
-ffunction-sections
-fdata-sections
-Wno-unused-parameter
-ffreestanding
-fno-move-loop-invariants
-Wall
-Wextra
)
# linker option
set(TARGET_MCU_LINKER
-mcpu=cortex-m3
-fmessage-length=0
-fsigned-char
-ffunction-sections
-Wall
-nostartfiles
-Xlinker --gc-sections
-Wl,--print-memory-usage
-Wl,--print-memory-usage
)
# target define
set(TARGET_MCU_DEF
-DDEBUG
-DUSE_FULL_ASSERT
-DSTM32F103xB
-DUSE_HAL_DRIVER
-DUSE_FULL_LL_DRIVER
-DHSE_VALUE=8000000
-D${MCU}
)