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