@@ -48,21 +48,20 @@ def __init__(self, target, notify=None, macros=None,
4848 self .flags ["ld" ].append ("--specs=nano.specs" )
4949
5050 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" ]
6262 else :
63- cpu = target .core .lower ()
63+ self . cpu = [ "-mcpu={}" . format ( target .core .lower ())]
6464
65- self .cpu = ["-mcpu=%s" % cpu ]
6665 if target .core .startswith ("Cortex-M" ):
6766 self .cpu .append ("-mthumb" )
6867
@@ -85,7 +84,9 @@ def __init__(self, target, notify=None, macros=None,
8584 self .cpu .append ("-mfloat-abi=hard" )
8685 self .cpu .append ("-mno-unaligned-access" )
8786
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" )):
8990 self .cpu .append ("-mcmse" )
9091 elif target .core == "Cortex-M23-NS" or target .core == "Cortex-M33-NS" :
9192 self .flags ["ld" ].append ("-D__DOMAIN_NS=1" )
0 commit comments