@@ -48,21 +48,20 @@ def __init__(self, target, notify=None, macros=None,
48
48
self .flags ["ld" ].append ("--specs=nano.specs" )
49
49
50
50
if target .core == "Cortex-M0+" :
51
- cpu = " cortex-m0plus"
52
- elif target .core == "Cortex-M4F" :
53
- cpu = " cortex-m4"
54
- elif target .core == "Cortex-M7F" :
55
- cpu = " cortex-m7"
56
- elif target .core == "Cortex-M7FD" :
57
- cpu = " cortex-m7"
58
- elif target .core == "Cortex-M23-NS" :
59
- cpu = " cortex-m23"
60
- elif target .core == "Cortex-M33-NS" :
61
- cpu = "cortex-m33"
51
+ self . cpu = [ "-mcpu= cortex-m0plus"]
52
+ elif target .core . startswith ( "Cortex-M4" ) :
53
+ self . cpu = [ "-mcpu= cortex-m4"]
54
+ elif target .core . startswith ( "Cortex-M7" ) :
55
+ self . cpu = [ "-mcpu= cortex-m7"]
56
+ elif target .core . startswith ( "Cortex-M23" ) :
57
+ self . cpu = [ "-mcpu= cortex-m23" ]
58
+ elif target .core . startswith ( "Cortex-M33F" ) :
59
+ self . cpu = [ "-mcpu= cortex-m33" ]
60
+ elif target .core . startswith ( "Cortex-M33" ) :
61
+ self . cpu = [ "-march=armv8-m.main" ]
62
62
else :
63
- cpu = target .core .lower ()
63
+ self . cpu = [ "-mcpu={}" . format ( target .core .lower ())]
64
64
65
- self .cpu = ["-mcpu=%s" % cpu ]
66
65
if target .core .startswith ("Cortex-M" ):
67
66
self .cpu .append ("-mthumb" )
68
67
@@ -85,7 +84,9 @@ def __init__(self, target, notify=None, macros=None,
85
84
self .cpu .append ("-mfloat-abi=hard" )
86
85
self .cpu .append ("-mno-unaligned-access" )
87
86
88
- if target .core == "Cortex-M23" or target .core == "Cortex-M33" :
87
+ if ((target .core .startswith ("Cortex-M23" ) or
88
+ target .core .startswith ("Cortex-M33" )) and
89
+ not target .core .endswith ("-NS" )):
89
90
self .cpu .append ("-mcmse" )
90
91
elif target .core == "Cortex-M23-NS" or target .core == "Cortex-M33-NS" :
91
92
self .flags ["ld" ].append ("-D__DOMAIN_NS=1" )
0 commit comments