Skip to content

Fix the removal of Mbed-added core flags in uvision exporter #10199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tools/export/uvision/__init__.py
Original file line number Diff line number Diff line change
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