@@ -53,37 +53,48 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
53
53
self .flags ["common" ].append ("-DMBED_RTOS_SINGLE_THREAD" )
54
54
self .flags ["ld" ].append ("--specs=nano.specs" )
55
55
56
- if target .core == "Cortex-M0+" :
56
+ core = target .core
57
+ if CORE_ARCH [target .core ] == 8 :
58
+ # Add linking time preprocessor macro DOMAIN_NS
59
+ if target .core .endswith ("-NS" ):
60
+ self .flags ["ld" ].append ("-DDOMAIN_NS=1" )
61
+ core = target .core [:- 3 ]
62
+ else :
63
+ self .cpu .append ("-mcmse" )
64
+ self .flags ["ld" ].extend ([
65
+ "-Wl,--cmse-implib" ,
66
+ "-Wl,--out-implib=%s" % join (build_dir , "cmse_lib.o" )
67
+ ])
68
+
69
+ if core == "Cortex-M0+" :
57
70
self .cpu = ["-mcpu=cortex-m0plus" ]
58
- elif target . core .startswith ("Cortex-M4" ):
71
+ elif core .startswith ("Cortex-M4" ):
59
72
self .cpu = ["-mcpu=cortex-m4" ]
60
- elif target . core .startswith ("Cortex-M7" ):
73
+ elif core .startswith ("Cortex-M7" ):
61
74
self .cpu = ["-mcpu=cortex-m7" ]
62
- elif target .core .startswith ("Cortex-M23" ):
63
- self .cpu = ["-mcpu=cortex-m23" ]
64
- elif target .core .startswith ("Cortex-M33FD" ):
75
+ elif core == "Cortex-M33FD" :
65
76
self .cpu = ["-mcpu=cortex-m33" ]
66
- elif target . core . startswith ( "Cortex-M33F" ) :
77
+ elif core == "Cortex-M33F" :
67
78
self .cpu = ["-mcpu=cortex-m33+nodsp" ]
68
- elif target . core . startswith ( "Cortex-M33" ) :
79
+ elif core == "Cortex-M33" :
69
80
self .cpu = ["-march=armv8-m.main" ]
70
81
else :
71
- self .cpu = ["-mcpu={}" .format (target . core .lower ())]
82
+ self .cpu = ["-mcpu={}" .format (core .lower ())]
72
83
73
84
if target .core .startswith ("Cortex-M" ):
74
85
self .cpu .append ("-mthumb" )
75
86
76
87
# FPU handling, M7 possibly to have double FPU
77
- if target . core == "Cortex-M4F" :
88
+ if core == "Cortex-M4F" :
78
89
self .cpu .append ("-mfpu=fpv4-sp-d16" )
79
90
self .cpu .append ("-mfloat-abi=softfp" )
80
- elif target . core == "Cortex-M7F" :
91
+ elif core == "Cortex-M7F" :
81
92
self .cpu .append ("-mfpu=fpv5-sp-d16" )
82
93
self .cpu .append ("-mfloat-abi=softfp" )
83
- elif target . core == "Cortex-M7FD" :
94
+ elif core == "Cortex-M7FD" :
84
95
self .cpu .append ("-mfpu=fpv5-d16" )
85
96
self .cpu .append ("-mfloat-abi=softfp" )
86
- elif target . core .startswith ("Cortex-M33F" ):
97
+ elif core .startswith ("Cortex-M33F" ):
87
98
self .cpu .append ("-mfpu=fpv5-sp-d16" )
88
99
self .cpu .append ("-mfloat-abi=softfp" )
89
100
@@ -95,17 +106,6 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
95
106
self .cpu .append ("-mfloat-abi=hard" )
96
107
self .cpu .append ("-mno-unaligned-access" )
97
108
98
- if CORE_ARCH [target .core ] == 8 :
99
- # Add linking time preprocessor macro DOMAIN_NS
100
- if target .core .endswith ("-NS" ):
101
- self .flags ["ld" ].append ("-DDOMAIN_NS=1" )
102
- else :
103
- self .cpu .append ("-mcmse" )
104
- self .flags ["ld" ].extend ([
105
- "-Wl,--cmse-implib" ,
106
- "-Wl,--out-implib=%s" % join (build_dir , "cmse_lib.o" )
107
- ])
108
-
109
109
self .flags ["common" ] += self .cpu
110
110
111
111
main_cc = join (tool_path , "arm-none-eabi-gcc" )
0 commit comments