[bsp][ra6m3-hmi-board] support gcc and llvm-arm toolchain. (#7553)
Co-authored-by: Man, Jianting (Meco) <920369182@qq.com>
This commit is contained in:
parent
b27f910cad
commit
3cc5fe5539
|
@ -290,6 +290,7 @@ jobs:
|
|||
RTT_TOOL_CHAIN: "llvm-arm"
|
||||
SUB_RTT_BSP:
|
||||
- "stm32/stm32l475-atk-pandora"
|
||||
- "renesas/ra6m3-hmi-board"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
|
|
|
@ -12,7 +12,7 @@ list = os.listdir(cwd)
|
|||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
print("\nThe current project does not support IAR build\n")
|
||||
Return('group')
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
if GetOption('target') != 'mdk5':
|
||||
CPPPATH = [cwd]
|
||||
src = Glob('./src/*.c')
|
||||
|
|
|
@ -11,7 +11,7 @@ src += Glob('pwm_audio.c')
|
|||
CPPPATH = [cwd]
|
||||
LOCAL_CFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
LOCAL_CFLAGS += ' -std=c99'
|
||||
elif rtconfig.PLATFORM in ['armcc']:
|
||||
LOCAL_CFLAGS += ' --c99'
|
||||
|
|
|
@ -8,7 +8,7 @@ src = Glob('*.c')
|
|||
CPPPATH = [cwd]
|
||||
LOCAL_CFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
LOCAL_CFLAGS += ' -std=c99'
|
||||
elif rtconfig.PLATFORM in ['armcc']:
|
||||
LOCAL_CFLAGS += ' --c99'
|
||||
|
|
|
@ -12,7 +12,7 @@ if GetDepend(['BSP_USING_RW007']):
|
|||
CPPPATH = [cwd]
|
||||
LOCAL_CFLAGS = ''
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
LOCAL_CFLAGS += ' -std=c99'
|
||||
elif rtconfig.PLATFORM in ['armcc']:
|
||||
LOCAL_CFLAGS += ' --c99'
|
||||
|
|
|
@ -10,7 +10,7 @@ CPPPATH = []
|
|||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
print("\nThe current project does not support IAR build\n")
|
||||
Return('group')
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
if GetOption('target') != 'mdk5':
|
||||
src += Glob(cwd + '/fsp/src/bsp/mcu/all/*.c')
|
||||
src += [cwd + '/fsp/src/bsp/cmsis/Device/RENESAS/Source/system.c']
|
||||
|
|
|
@ -64,7 +64,12 @@ void Reset_Handler (void)
|
|||
SystemInit();
|
||||
|
||||
/* Call user application. */
|
||||
#ifdef __ARMCC_VERSION
|
||||
main();
|
||||
#elif defined(__GNUC__)
|
||||
extern int entry(void);
|
||||
entry();
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ CPPPATH = []
|
|||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
print("\nThe current project does not support IAR build\n")
|
||||
Return('group')
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
if GetOption('target') != 'mdk5':
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd+'/fsp_cfg', cwd + '/fsp_cfg/bsp']
|
||||
|
|
|
@ -10,7 +10,7 @@ CPPPATH = []
|
|||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
print("\nThe current project does not support IAR build\n")
|
||||
Return('group')
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang']:
|
||||
elif rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']:
|
||||
if GetOption('target') != 'mdk5':
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, ]
|
||||
|
|
|
@ -4,7 +4,7 @@ import sys
|
|||
# toolchains options
|
||||
ARCH='arm'
|
||||
CPU='cortex-m4'
|
||||
CROSS_TOOL='keil'
|
||||
CROSS_TOOL='gcc'
|
||||
|
||||
if os.getenv('RTT_CC'):
|
||||
CROSS_TOOL = os.getenv('RTT_CC')
|
||||
|
@ -22,6 +22,9 @@ elif CROSS_TOOL == 'keil':
|
|||
elif CROSS_TOOL == 'iar':
|
||||
PLATFORM = 'iccarm'
|
||||
EXEC_PATH = r'C:/Program Files/IAR Systems/Embedded Workbench 8.0'
|
||||
elif CROSS_TOOL == 'llvm-arm':
|
||||
PLATFORM = 'llvm-arm'
|
||||
EXEC_PATH = r'D:\Progrem\LLVMEmbeddedToolchainForArm-16.0.0-Windows-x86_64\bin'
|
||||
|
||||
if os.getenv('RTT_EXEC_PATH'):
|
||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||
|
@ -93,6 +96,37 @@ elif PLATFORM == 'armclang':
|
|||
CFLAGS += ' -Os'
|
||||
|
||||
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET \n'
|
||||
elif PLATFORM == 'llvm-arm':
|
||||
# toolchains
|
||||
PREFIX = 'llvm-'
|
||||
CC = 'clang'
|
||||
AS = 'clang'
|
||||
AR = PREFIX + 'ar'
|
||||
CXX = 'clang++'
|
||||
LINK = 'clang'
|
||||
TARGET_EXT = 'elf'
|
||||
SIZE = PREFIX + 'size'
|
||||
OBJDUMP = PREFIX + 'objdump'
|
||||
OBJCPY = PREFIX + 'objcopy'
|
||||
DEVICE = ' --config armv7em_hard_fpv4_sp_d16.cfg'
|
||||
DEVICE += ' -ffunction-sections -fdata-sections'
|
||||
CFLAGS = DEVICE
|
||||
CFLAGS += ' -mfloat-abi=hard -march=armv7em -mfpu=fpv4-sp-d16'
|
||||
AFLAGS = ' -c' + DEVICE + ' -Wa,-mimplicit-it=thumb ' ## -x assembler-with-cpp
|
||||
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rt-thread.map,-u,Reset_Handler -T script/fsp.ld -L script/'
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
|
||||
if BUILD == 'debug':
|
||||
CFLAGS += ' -O0 -gdwarf-2 -g'
|
||||
AFLAGS += ' -gdwarf-2'
|
||||
else:
|
||||
CFLAGS += ' -O2'
|
||||
|
||||
CXXFLAGS = CFLAGS
|
||||
|
||||
POST_ACTION = OBJCPY + ' -O ihex $TARGET rtthread.hex\n' + SIZE + ' $TARGET \n'
|
||||
|
||||
def dist_handle(BSP_ROOT, dist_dir):
|
||||
import sys
|
||||
|
|
|
@ -86,7 +86,7 @@ MEMORY
|
|||
}
|
||||
|
||||
/* Library configurations */
|
||||
GROUP(libgcc.a libc.a libm.a libnosys.a)
|
||||
GROUP(libc.a libm.a)
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
|
|
Loading…
Reference in New Issue