summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorZhaoxing Li <[email protected]>2021-07-01 13:02:06 +0800
committerGitHub <[email protected]>2021-07-01 13:02:06 +0800
commit6175a594e27219b0e82db7e061a6ce746b1cb3f7 (patch)
treebc2fd0a520c2c5acbdd61ba888d775339793b109 /bsp
parent7b9904a15279a90b128d301800e54dcf4b227f69 (diff)
parentde4fc407068f06606772d4e667399dc04f218289 (diff)
Merge branch 'RT-Thread:master' into dev-bsp-robomaster-c
Diffstat (limited to 'bsp')
-rw-r--r--bsp/stm32/stm32f412-st-nucleo/rtconfig.py34
-rw-r--r--bsp/stm32/stm32h750-artpi-h750/rtconfig.py34
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/rtconfig.py4
3 files changed, 70 insertions, 2 deletions
diff --git a/bsp/stm32/stm32f412-st-nucleo/rtconfig.py b/bsp/stm32/stm32f412-st-nucleo/rtconfig.py
index 573c1f7492..9193d4a1d5 100644
--- a/bsp/stm32/stm32f412-st-nucleo/rtconfig.py
+++ b/bsp/stm32/stm32f412-st-nucleo/rtconfig.py
@@ -94,6 +94,40 @@ 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 = ' --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
+ CFLAGS += ' -std=c99'
+
+ POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
+
elif PLATFORM == 'iar':
# toolchains
CC = 'iccarm'
diff --git a/bsp/stm32/stm32h750-artpi-h750/rtconfig.py b/bsp/stm32/stm32h750-artpi-h750/rtconfig.py
index 2c9cbdd792..13a0ebbdb9 100644
--- a/bsp/stm32/stm32h750-artpi-h750/rtconfig.py
+++ b/bsp/stm32/stm32h750-artpi-h750/rtconfig.py
@@ -94,6 +94,40 @@ 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-M7.fp.sp '
+ CFLAGS = ' --target=arm-arm-none-eabi -mcpu=cortex-M7 '
+ CFLAGS += ' -mcpu=cortex-M7 -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
+ CFLAGS += ' -std=c99'
+
+ POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
+
elif PLATFORM == 'iar':
# toolchains
CC = 'iccarm'
diff --git a/bsp/stm32/stm32l475-atk-pandora/rtconfig.py b/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
index 9314a28375..4250a3d152 100644
--- a/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
+++ b/bsp/stm32/stm32l475-atk-pandora/rtconfig.py
@@ -91,7 +91,6 @@ elif PLATFORM == 'armcc':
CXXFLAGS = CFLAGS
- CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
@@ -105,7 +104,7 @@ elif PLATFORM == 'armclang':
TARGET_EXT = 'axf'
DEVICE = ' --cpu Cortex-M4.fp '
- CFLAGS = ' -xc -std=c99 --target=arm-arm-none-eabi -mcpu=cortex-m4 '
+ CFLAGS = ' --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 '
@@ -125,6 +124,7 @@ elif PLATFORM == 'armclang':
CFLAGS += ' -O2'
CXXFLAGS = CFLAGS
+ CFLAGS += ' -std=c99'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'