forked from SchumyHao/wrtnode2r_stm32
-
Notifications
You must be signed in to change notification settings - Fork 16
/
rtconfig.py
48 lines (37 loc) · 1.16 KB
/
rtconfig.py
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
import os
# toolchains options
ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
PLATFORM = 'gcc'
EXEC_PATH = '/Users/schumy/arm-gcc/bin'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
BUILD = ''
STM32_TYPE = 'STM32F10X_MD'
R_VERSION = 'V0.9'
PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc'
CXX = PREFIX + 'g++'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'g++'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mcpu=cortex-m3 -march=armv7-m -mthumb -DMCU_STM32F103T8 -DBOOTLOADER_wrtnode'
CFLAGS = DEVICE + ' -ffunction-sections -fdata-sections'
CXXFLAGS = DEVICE + ' -fno-exceptions -fno-rtti -DMAPLE_USE_WIRISHC'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
LFLAGS = DEVICE + ' -nostdlib -Wl,--gc-sections,-Map=rtthread-stm32.map,-cref,-u,Reset_Handler -T stm32_rom.ld'
CPATH = ''
LPATH = ''
if BUILD == 'debug':
CFLAGS += ' -Og -gdwarf-2'
AFLAGS += ' -gdwarf-2'
else:
CFLAGS += ' -Og'
POST_ACTION = OBJCPY + ' -O binary $TARGET WRTnode_2r_STM32_rtthread_' + R_VERSION + '.bin\n' + SIZE + ' $TARGET \n'