diff options
| author | Wang Chen <[email protected]> | 2025-04-02 15:04:51 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2025-04-24 14:34:25 +0800 |
| commit | 980a376e9b56f2048a8cc1ae2002fa52ccbbb04d (patch) | |
| tree | 586509cc05e1ecc81d6a2096636d7d9a42a3b4f5 /bsp/k230/rtconfig.py | |
| parent | 6229153364e3fe7d9476e9cbd5eebb1905753777 (diff) | |
bsp: k230: support canmv board
Some changes to support canmv board, such as:
- Address constant, some may need be set as configuration later.
- link script
- build script
Signed-off-by: Wang Chen <[email protected]>
Diffstat (limited to 'bsp/k230/rtconfig.py')
| -rw-r--r-- | bsp/k230/rtconfig.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bsp/k230/rtconfig.py b/bsp/k230/rtconfig.py index 5d7f5b3b21..4cd6df869a 100644 --- a/bsp/k230/rtconfig.py +++ b/bsp/k230/rtconfig.py @@ -1,4 +1,5 @@ import os +import re # toolchains options ARCH ='risc-v' @@ -13,14 +14,18 @@ if os.getenv('RTT_CC'): if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - EXEC_PATH = r'/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1/bin' + EXEC_PATH = r'/opt/toolchain/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_rtt/bin' else: print('Please make sure your toolchains is GNU GCC!') exit(0) -EXEC_PATH = os.getenv('RTT_EXEC_PATH', EXEC_PATH) +if os.getenv('RTT_EXEC_PATH'): + EXEC_PATH = os.getenv('RTT_EXEC_PATH') -BUILD = 'debug' +if re.match("-DDBGLV=0", os.getenv('KCFLAGS', '-DDBGLV=0')): + BUILD = 'release' +else: + BUILD = 'debug' if PLATFORM == 'gcc': # toolchains @@ -36,7 +41,7 @@ if PLATFORM == 'gcc': OBJDUMP = PREFIX + 'objdump' OBJCPY = PREFIX + 'objcopy' - DEVICE = ' -mcmodel=medany -march=rv64imafdc -mabi=lp64' + DEVICE = ' -mcmodel=medany -march=rv64imafdcv -mabi=lp64d' CFLAGS = DEVICE + ' -Wno-cpp -fvar-tracking -ffreestanding -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -D_POSIX_SOURCE ' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__' LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,_start -T link.lds' + ' -lsupc++ -lgcc -static' @@ -44,10 +49,11 @@ if PLATFORM == 'gcc': LPATH = '' if BUILD == 'debug': - CFLAGS += ' -O2 -g -gdwarf-2' - AFLAGS += ' -g -gdwarf-2' + CFLAGS += ' -O0 -gdwarf-2' + AFLAGS += ' -gdwarf-2' else: CFLAGS += ' -O2 -g -gdwarf-2' + CFLAGS += ' ' + os.getenv('KCFLAGS', '-DDBGLV=0') CXXFLAGS = CFLAGS |
