@@ -33,6 +33,8 @@ class ARM(mbedToolchain):
33
33
INDEX_PATTERN = re .compile ('(?P<col>\s*)\^' )
34
34
DEP_PATTERN = re .compile ('\S+:\s(?P<file>.+)\n ' )
35
35
SHEBANG = "#! armcc -E"
36
+ SUPPORTED_CORES = ["Cortex-M0" , "Cortex-M0+" , "Cortex-M3" , "Cortex-M4" ,
37
+ "Cortex-M4F" , "Cortex-M7" , "Cortex-M7F" , "Cortex-M7FD" ]
36
38
37
39
@staticmethod
38
40
def check_executable ():
@@ -48,9 +50,9 @@ def __init__(self, target, notify=None, macros=None,
48
50
build_dir = build_dir ,
49
51
extra_verbose = extra_verbose ,
50
52
build_profile = build_profile )
51
-
52
- if "ARM" not in target . supported_toolchains :
53
- raise NotSupportedException ( "ARM compiler support is required for ARM build" )
53
+ if target . core not in self . SUPPORTED_CORES :
54
+ raise NotSupportedException (
55
+ "this compiler does not support the core %s" % target . core )
54
56
55
57
if target .core == "Cortex-M0+" :
56
58
cpu = "Cortex-M0"
@@ -265,19 +267,42 @@ def redirect_symbol(source, sync, build_dir):
265
267
266
268
267
269
class ARM_STD (ARM ):
268
- pass
270
+ def __init__ (self , target , notify = None , macros = None ,
271
+ silent = False , extra_verbose = False , build_profile = None ,
272
+ build_dir = None ):
273
+ ARM .__init__ (self , target , notify , macros , silent ,
274
+ build_dir = build_dir , extra_verbose = extra_verbose ,
275
+ build_profile = build_profile )
276
+ if "ARM" not in target .supported_toolchains :
277
+ raise NotSupportedException ("ARM compiler support is required for ARM build" )
278
+
269
279
270
280
class ARM_MICRO (ARM ):
271
281
PATCHED_LIBRARY = False
282
+ def __init__ (self , target , notify = None , macros = None ,
283
+ silent = False , extra_verbose = False , build_profile = None ,
284
+ build_dir = None ):
285
+ ARM .__init__ (self , target , notify , macros , silent ,
286
+ build_dir = build_dir , extra_verbose = extra_verbose ,
287
+ build_profile = build_profile )
288
+ if not set (("ARM" , "uARM" )).intersection (set (target .supported_toolchains )):
289
+ raise NotSupportedException ("ARM/uARM compiler support is required for ARM build" )
272
290
273
291
class ARMC6 (ARM_STD ):
274
292
SHEBANG = "#! armclang -E --target=arm-arm-none-eabi -x c"
293
+ SUPPORTED_CORES = ["Cortex-M0" , "Cortex-M0+" , "Cortex-M3" , "Cortex-M4" ,
294
+ "Cortex-M4F" , "Cortex-M7" , "Cortex-M7F" , "Cortex-M7FD" ,
295
+ "Cortex-M23" , "Cortex-M23-NS" , "Cortex-M33" ,
296
+ "CortexM33-NS" ]
275
297
@staticmethod
276
298
def check_executable ():
277
299
return mbedToolchain .generic_check_executable ("ARMC6" , "armclang" , 1 )
278
300
279
301
def __init__ (self , target , * args , ** kwargs ):
280
302
mbedToolchain .__init__ (self , target , * args , ** kwargs )
303
+ if target .core not in self .SUPPORTED_CORES :
304
+ raise NotSupportedException (
305
+ "this compiler does not support the core %s" % target .core )
281
306
282
307
if not set (("ARM" , "ARMC6" )).intersection (set (target .supported_toolchains )):
283
308
raise NotSupportedException ("ARM/ARMC6 compiler support is required for ARMC6 build" )
0 commit comments