@@ -82,16 +82,11 @@ def __init__(self, target, notify=None, macros=None,
82
82
if "--library_type=microlib" not in self .flags ['common' ]:
83
83
self .flags ['common' ].append ("--library_type=microlib" )
84
84
85
- if target .core == "Cortex-M0+" :
86
- cpu = "Cortex-M0"
87
- elif target .core == "Cortex-M4F" :
88
- cpu = "Cortex-M4.fp"
89
- elif target .core == "Cortex-M7FD" :
90
- cpu = "Cortex-M7.fp.dp"
91
- elif target .core == "Cortex-M7F" :
92
- cpu = "Cortex-M7.fp.sp"
93
- else :
94
- cpu = target .core
85
+ cpu = {
86
+ "Cortex-M0+" : "Cortex-M0plus" ,
87
+ "Cortex-M4F" : "Cortex-M4.fp.sp" ,
88
+ "Cortex-M7F" : "Cortex-M7.fp.sp" ,
89
+ "Cortex-M7FD" : "Cortex-M7.fp.dp" }.get (target .core , target .core )
95
90
96
91
ARM_BIN = join (TOOLCHAIN_PATHS ['ARM' ], "bin" )
97
92
@@ -559,38 +554,31 @@ def __init__(self, target, *args, **kwargs):
559
554
self .SHEBANG += " -mcpu=%s" % cpu
560
555
561
556
# FPU handling
562
- if core == "Cortex-M4F" :
557
+ if core == "Cortex-M4" or core == "Cortex-M7" or "core" == "Cortex-M33" :
558
+ self .flags ['common' ].append ("-mfpu=none" )
559
+ elif core == "Cortex-M4F" :
563
560
self .flags ['common' ].append ("-mfpu=fpv4-sp-d16" )
564
561
self .flags ['common' ].append ("-mfloat-abi=hard" )
565
- self .flags ['ld' ].append ("--cpu=cortex-m4" )
566
- elif core == "Cortex-M7F" :
562
+ elif core == "Cortex-M7F" or core .startswith ("Cortex-M33F" ):
567
563
self .flags ['common' ].append ("-mfpu=fpv5-sp-d16" )
568
564
self .flags ['common' ].append ("-mfloat-abi=hard" )
569
- self .flags ['ld' ].append ("--cpu=cortex-m7.fp.sp" )
570
565
elif core == "Cortex-M7FD" :
571
566
self .flags ['common' ].append ("-mfpu=fpv5-d16" )
572
567
self .flags ['common' ].append ("-mfloat-abi=hard" )
573
- self .flags ['ld' ].append ("--cpu=cortex-m7" )
574
- elif core == "Cortex-M33F" :
575
- self .flags ['common' ].append ("-mfpu=fpv5-sp-d16" )
576
- self .flags ['common' ].append ("-mfloat-abi=hard" )
577
- self .flags ['ld' ].append ("--cpu=cortex-m33.no_dsp" )
578
- elif core == "Cortex-M33" :
579
- self .flags ['common' ].append ("-mfpu=none" )
580
- self .flags ['ld' ].append ("--cpu=cortex-m33.no_dsp.no_fp" )
581
- else :
582
- self .flags ['ld' ].append ("--cpu=%s" % cpu )
583
568
584
- asm_cpu = {
585
- "Cortex-M0+" : "Cortex-M0" ,
586
- "Cortex-M4F" : "Cortex-M4.fp" ,
569
+ asm_ld_cpu = {
570
+ "Cortex-M0+" : "Cortex-M0plus" ,
571
+ "Cortex-M4" : "Cortex-M4.no_fp" ,
572
+ "Cortex-M4F" : "Cortex-M4" ,
573
+ "Cortex-M7" : "Cortex-M7.no_fp" ,
587
574
"Cortex-M7F" : "Cortex-M7.fp.sp" ,
588
- "Cortex-M7FD" : "Cortex-M7.fp.dp " ,
575
+ "Cortex-M7FD" : "Cortex-M7" ,
589
576
"Cortex-M33" : "Cortex-M33.no_dsp.no_fp" ,
590
577
"Cortex-M33F" : "Cortex-M33.no_dsp" ,
591
578
"Cortex-M33FE" : "Cortex-M33" }.get (core , core )
592
579
593
- self .flags ['asm' ].append ("--cpu=%s" % asm_cpu )
580
+ self .flags ['asm' ].append ("--cpu=%s" % asm_ld_cpu )
581
+ self .flags ['ld' ].append ("--cpu=%s" % asm_ld_cpu )
594
582
595
583
self .cc = ([join (TOOLCHAIN_PATHS ["ARMC6" ], "armclang" )] +
596
584
self .flags ['common' ] + self .flags ['c' ])
0 commit comments