Skip to content

Commit

Permalink
Merge pull request #10199 from bridadan/fix_cores_in_uvision
Browse files Browse the repository at this point in the history
Fix the removal of Mbed-added core flags in uvision exporter
  • Loading branch information
Cruz Monrreal committed Mar 23, 2019
2 parents ac118ea + f56bf8f commit 4e514ae
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tools/export/uvision/__init__.py
Expand Up @@ -11,7 +11,7 @@
import re

from tools.resources import FileType
from tools.targets import TARGET_MAP
from tools.targets import TARGET_MAP, CORE_ARCH
from tools.export.exporters import Exporter
from tools.export.cmsis import DeviceCMSIS

Expand Down Expand Up @@ -217,9 +217,12 @@ def format_src(self, srcs):
@staticmethod
def format_fpu(core):
"""Generate a core's FPU string"""
if core.endswith("FD"):
fpu_core_name = core.replace("-NS", "").rstrip("E")
if fpu_core_name.endswith("FD"):
return "FPU3(DFPU)"
elif core.endswith("F"):
elif fpu_core_name.endswith("F"):
if CORE_ARCH[core] == 8:
return "FPU3(SFPU)"
return "FPU2"
else:
return ""
Expand Down Expand Up @@ -247,10 +250,11 @@ def generate(self):
sct_path, dirname(sct_name))
if ctx['linker_script'] != sct_path:
self.generated_files.append(ctx['linker_script'])
ctx['cputype'] = ctx['device'].core.rstrip("FD").replace("-NS", "")
if ctx['device'].core.endswith("FD"):
fpu_included_core_name = ctx['device'].core.replace("-NS", "")
ctx['cputype'] = fpu_included_core_name.rstrip("FDE")
if fpu_included_core_name.endswith("FD"):
ctx['fpu_setting'] = 3
elif ctx['device'].core.endswith("F"):
elif fpu_included_core_name.rstrip("E").endswith("F"):
ctx['fpu_setting'] = 2
else:
ctx['fpu_setting'] = 1
Expand Down

0 comments on commit 4e514ae

Please sign in to comment.