Skip to content

Commit

Permalink
Fixing Cortex-A and SARA_NBIOT_EVK build failures (#3)
Browse files Browse the repository at this point in the history
* Adding Cortex-A support for gnuarmeclipse
* Preventing '-mthumb' from being added to Cortex-A builds.
Previously, both '-mthumb' and '-marm' were being supplied to the
compiler (in that order). Because '-marm' came last, the compiler
respected this option. This change makes it so '-mthumb' is added for
all 'Cortex-M' targets only.
* Renaming to capital .S for Eclipse compatibility
  • Loading branch information
bridadan authored and ilg-ul committed Feb 7, 2017
1 parent 57e93a5 commit b0739d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tools/export/gnuarmeclipse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ def process_options(self, opts, flags_in):
'Cortex-M7': {'mcpu': 'cortex-m7', 'fpu_unit': None},
'Cortex-M7F': {'mcpu': 'cortex-m7', 'fpu_unit': 'fpv4spd16'},
'Cortex-M7FD': {'mcpu': 'cortex-m7', 'fpu_unit': 'fpv5d16'},
'Cortex-A9': {'mcpu': 'cortex-a9', 'fpu_unit': 'vfpv3'}
}

# Remove options that are supplied by CDT
Expand Down Expand Up @@ -635,9 +636,9 @@ def process_options(self, opts, flags_in):
opts['common']['arm.target.arch'] = 'none'
str = self.find_options(flags['common_flags'], '-march=')
arch = str[len('-march='):]
archs = {'armv6-m': 'armv6-m', 'armv7-m': 'armv7-m'}
archs = {'armv6-m': 'armv6-m', 'armv7-m': 'armv7-m', 'armv7-a': 'armv7-a'}
if arch in archs:
opts['common']['arm.target.arch'] = archs[arh]
opts['common']['arm.target.arch'] = archs[arch]
self.remove_option(flags['common_flags'], str)

opts['common']['arm.target.instructionset'] = 'thumb'
Expand Down
2 changes: 1 addition & 1 deletion tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, target, notify=None, macros=None,
cpu = target.core.lower()

self.cpu = ["-mcpu=%s" % cpu]
if target.core.startswith("Cortex"):
if target.core.startswith("Cortex-M"):
self.cpu.append("-mthumb")

# FPU handling, M7 possibly to have double FPU
Expand Down

0 comments on commit b0739d7

Please sign in to comment.