summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2021-01-20 13:50:59 +0800
committerGitee <[email protected]>2021-01-20 13:50:59 +0800
commit9f4ce7ee6faef172b9b8ecd093c2f9177d892865 (patch)
treed717b8adc8a4de93f60a15e5fe0a111c53e87545
parent60c695073f263ec6787bab4989c1e0fa46808718 (diff)
parentb546e25f9f47e9a302f43a6adebf76b7dd54eb95 (diff)
!113 添加armclang支持
Merge pull request !113 from shuobatian/gitee_master
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/rtconfig.py36
-rw-r--r--components/drivers/spi/SConscript5
-rw-r--r--libcpu/arm/cortex-m4/SConscript3
3 files changed, 42 insertions, 2 deletions
diff --git a/bsp/stm32/stm32l475-atk-pandora/rtconfig.py b/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
index f09dfbc3b7..9314a28375 100644
--- a/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
+++ b/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
@@ -73,7 +73,8 @@ elif PLATFORM == 'armcc':
DEVICE = ' --cpu Cortex-M4.fp '
CFLAGS = '-c ' + DEVICE + ' --apcs=interwork --c99'
AFLAGS = DEVICE + ' --apcs=interwork '
- LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rt-thread.map --strict --scatter "board\linker_scripts\link.sct"'
+ LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rt-thread.map '
+ LFLAGS += r' --strict --scatter "board\linker_scripts\link.sct" '
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCC/include'
LFLAGS += ' --libpath=' + EXEC_PATH + '/ARM/ARMCC/lib'
@@ -94,6 +95,39 @@ elif PLATFORM == 'armcc':
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
+elif PLATFORM == 'armclang':
+ # toolchains
+ CC = 'armclang'
+ CXX = 'armclang'
+ AS = 'armasm'
+ AR = 'armar'
+ LINK = 'armlink'
+ TARGET_EXT = 'axf'
+
+ DEVICE = ' --cpu Cortex-M4.fp '
+ CFLAGS = ' -xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 '
+ CFLAGS += ' -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 '
+ CFLAGS += ' -mfloat-abi=hard -c -fno-rtti -funsigned-char -fshort-enums -fshort-wchar '
+ CFLAGS += ' -gdwarf-3 -ffunction-sections '
+ AFLAGS = DEVICE + ' --apcs=interwork '
+ LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers '
+ LFLAGS += ' --list rt-thread.map '
+ LFLAGS += r' --strict --scatter "board\linker_scripts\link.sct" '
+ CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCLANG/include'
+ LFLAGS += ' --libpath=' + EXEC_PATH + '/ARM/ARMCLANG/lib'
+
+ EXEC_PATH += '/ARM/ARMCLANG/bin/'
+
+ if BUILD == 'debug':
+ CFLAGS += ' -g -O1' # armclang recommend
+ AFLAGS += ' -g'
+ else:
+ CFLAGS += ' -O2'
+
+ CXXFLAGS = CFLAGS
+
+ POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
+
elif PLATFORM == 'iar':
# toolchains
CC = 'iccarm'
diff --git a/components/drivers/spi/SConscript b/components/drivers/spi/SConscript
index e19f30861f..d6cb93f7f1 100644
--- a/components/drivers/spi/SConscript
+++ b/components/drivers/spi/SConscript
@@ -28,7 +28,10 @@ if GetDepend('RT_USING_SFUD'):
if rtconfig.CROSS_TOOL == 'gcc':
LOCAL_CCFLAGS += ' -std=c99'
elif rtconfig.CROSS_TOOL == 'keil':
- LOCAL_CCFLAGS += ' --c99'
+ if rtconfig.PLATFORM == 'armcc':
+ LOCAL_CCFLAGS += ' --c99'
+ elif rtconfig.PLATFORM == 'armclang':
+ LOCAL_CCFLAGS += ' -std=c99'
src += src_device
diff --git a/libcpu/arm/cortex-m4/SConscript b/libcpu/arm/cortex-m4/SConscript
index 9ff30a796b..d03dfb9c07 100644
--- a/libcpu/arm/cortex-m4/SConscript
+++ b/libcpu/arm/cortex-m4/SConscript
@@ -11,6 +11,9 @@ CPPPATH = [cwd]
if rtconfig.PLATFORM == 'armcc':
src += Glob('*_rvds.S')
+if rtconfig.PLATFORM == 'armclang':
+ src += Glob('*_rvds.S')
+
if rtconfig.PLATFORM == 'gcc':
src += Glob('*_init.S')
src += Glob('*_gcc.S')