mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 13:53:32 +08:00
99526cc047
feat: move MRS demo source to bsp and libraries folder feat: update Sconscript feat: modify SConstruct in the bsp feat: use the rtconfig.py of gd32vf103v-eval bsp to modify feat: use the MRS's rtconfig.h temoporarily feat: update Kconfig files feat: use the MRS's .ld and rename as link.lds feat: add ch32v1 porting folder perf: remove board/system_ch32v10x.c fix: define SOC_ARM_SERIES_CH32V103 in rtconfig.h fix: add some neccessary macros in rtconfig.h perf: use the menuconfig to generate rtconfig.h feat: add readme.md fix: correct the bad encode in main.c fix: include board.h in main.c perf: check and update README.md perf: remove ch32f10x_port_cn.md feat: ignore the standard libraries's CI checking feat: add sdk_dist.py fix: correct some style errors again perf: simply the board/kconfig fix: format ch32v103r-evt fix: format drvs and libcpu
63 lines
1.7 KiB
Python
63 lines
1.7 KiB
Python
import os
|
|
ARCH = 'risc-v'
|
|
CPU = 'ch32v1'
|
|
# toolchains options
|
|
CROSS_TOOL = 'gcc'
|
|
|
|
#------- toolchains path -------------------------------------------------------
|
|
if os.getenv('RTT_CC'):
|
|
CROSS_TOOL = os.getenv('RTT_CC')
|
|
|
|
if CROSS_TOOL == 'gcc':
|
|
PLATFORM = 'gcc'
|
|
EXEC_PATH = r'D:/Softwares/RT_ThreadStudio/repo/Extract/ToolChain_Support_Packages/WCH/RISC-V-GCC-WCH/8.2.0/bin'
|
|
else:
|
|
print('Please make sure your toolchains is GNU GCC!')
|
|
exit(0)
|
|
|
|
# if os.getenv('RTT_EXEC_PATH'):
|
|
# EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
|
|
|
BUILD = 'debug'
|
|
#BUILD = 'release'
|
|
|
|
CORE = 'risc-v'
|
|
MAP_FILE = 'rtthread.map'
|
|
LINK_FILE = './board/linker_scripts/link.lds'
|
|
TARGET_NAME = 'rtthread.bin'
|
|
|
|
#------- GCC settings ----------------------------------------------------------
|
|
if PLATFORM == 'gcc':
|
|
# toolchains
|
|
PREFIX = 'riscv-none-embed-'
|
|
CC = PREFIX + 'gcc'
|
|
CXX= PREFIX + 'g++'
|
|
AS = PREFIX + 'gcc'
|
|
AR = PREFIX + 'ar'
|
|
LINK = PREFIX + 'gcc'
|
|
TARGET_EXT = 'elf'
|
|
SIZE = PREFIX + 'size'
|
|
OBJDUMP = PREFIX + 'objdump'
|
|
OBJCPY = PREFIX + 'objcopy'
|
|
|
|
DEVICE = ' -march=rv32imac -mabi=ilp32 -DUSE_PLIC -DUSE_M_TIME -DNO_INIT -mcmodel=medany -msmall-data-limit=8 -L. -nostartfiles -lc '
|
|
CFLAGS = DEVICE
|
|
CFLAGS += ' -save-temps=obj'
|
|
AFLAGS = '-c'+ DEVICE + ' -x assembler-with-cpp'
|
|
LFLAGS = DEVICE
|
|
LFLAGS += ' -Wl,--gc-sections,-cref,-Map=' + MAP_FILE
|
|
LFLAGS += ' -T ' + LINK_FILE
|
|
LFLAGS += ' -Wl,-wrap=memset'
|
|
|
|
CPATH = ''
|
|
LPATH = ''
|
|
|
|
if BUILD == 'debug':
|
|
CFLAGS += ' -O0 -g3'
|
|
AFLAGS += ' -g3'
|
|
else:
|
|
CFLAGS += ' -O2'
|
|
|
|
POST_ACTION = OBJCPY + ' -O binary $TARGET ' + TARGET_NAME + '\n'
|
|
POST_ACTION += SIZE + ' $TARGET\n'
|