Skip to content

Commit 4e514ae

Browse files
author
Cruz Monrreal
authored
Merge pull request #10199 from bridadan/fix_cores_in_uvision
Fix the removal of Mbed-added core flags in uvision exporter
2 parents ac118ea + f56bf8f commit 4e514ae

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/export/uvision/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import re
1212

1313
from tools.resources import FileType
14-
from tools.targets import TARGET_MAP
14+
from tools.targets import TARGET_MAP, CORE_ARCH
1515
from tools.export.exporters import Exporter
1616
from tools.export.cmsis import DeviceCMSIS
1717

@@ -217,9 +217,12 @@ def format_src(self, srcs):
217217
@staticmethod
218218
def format_fpu(core):
219219
"""Generate a core's FPU string"""
220-
if core.endswith("FD"):
220+
fpu_core_name = core.replace("-NS", "").rstrip("E")
221+
if fpu_core_name.endswith("FD"):
221222
return "FPU3(DFPU)"
222-
elif core.endswith("F"):
223+
elif fpu_core_name.endswith("F"):
224+
if CORE_ARCH[core] == 8:
225+
return "FPU3(SFPU)"
223226
return "FPU2"
224227
else:
225228
return ""
@@ -247,10 +250,11 @@ def generate(self):
247250
sct_path, dirname(sct_name))
248251
if ctx['linker_script'] != sct_path:
249252
self.generated_files.append(ctx['linker_script'])
250-
ctx['cputype'] = ctx['device'].core.rstrip("FD").replace("-NS", "")
251-
if ctx['device'].core.endswith("FD"):
253+
fpu_included_core_name = ctx['device'].core.replace("-NS", "")
254+
ctx['cputype'] = fpu_included_core_name.rstrip("FDE")
255+
if fpu_included_core_name.endswith("FD"):
252256
ctx['fpu_setting'] = 3
253-
elif ctx['device'].core.endswith("F"):
257+
elif fpu_included_core_name.rstrip("E").endswith("F"):
254258
ctx['fpu_setting'] = 2
255259
else:
256260
ctx['fpu_setting'] = 1

0 commit comments

Comments
 (0)