mirror of https://github.com/ARMmbed/mbed-os.git
Correct the floating+dsp options for Cortex-M processors
As per the IAR Development guide, below options for CPU are valid 1. Cortex-M33 2. Cortex-M33.no_dsp (core without integer DSP extension) 3. Cortex-M33.fp (floating-point unit with support for single precision) 4. Cortex-M33.no_se (core without support for TrustZone) 5. Cortex-M4 6. Cortex-M4F 7. Cortex-M7 8. Cortex-M7.fp.dp (floating-point unit with support for double precision) 9. Cortex-M7.fp.sp (floating-point unit with support for single precision)pull/9646/head
parent
3493e3ef56
commit
ddf5060ef9
|
@ -44,25 +44,34 @@ class IAR(mbedToolchain):
|
||||||
|
|
||||||
def __init__(self, target, notify=None, macros=None, build_profile=None,
|
def __init__(self, target, notify=None, macros=None, build_profile=None,
|
||||||
build_dir=None):
|
build_dir=None):
|
||||||
mbedToolchain.__init__(self, target, notify, macros, build_dir=build_dir,
|
mbedToolchain.__init__(self, target, notify, macros, build_dir=build_dir,build_profile=build_profile)
|
||||||
build_profile=build_profile)
|
core = target.core
|
||||||
if target.core == "Cortex-M7F" or target.core == "Cortex-M7FD":
|
if CORE_ARCH[target.core] == 8:
|
||||||
cpuchoice = "Cortex-M7"
|
# Add linking time preprocessor macro DOMAIN_NS
|
||||||
elif target.core.startswith("Cortex-M33FD"):
|
if target.core.endswith("-NS"):
|
||||||
cpuchoice = "Cortex-M33"
|
define_string = self.make_ld_define("DOMAIN_NS", "0x1")
|
||||||
elif target.core.startswith("Cortex-M33"):
|
self.flags["ld"].append(define_string)
|
||||||
cpuchoice = "Cortex-M33.no_dsp"
|
core = target.core[:-3]
|
||||||
elif target.core.startswith("Cortex-M23"):
|
else:
|
||||||
cpuchoice = "Cortex-M23"
|
# Create Secure library
|
||||||
else:
|
self.flags["asm"] += ["--cmse"]
|
||||||
cpuchoice = target.core
|
self.flags["common"] += ["--cmse"]
|
||||||
|
secure_file = join(build_dir, "cmse_lib.o")
|
||||||
|
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
|
||||||
|
|
||||||
|
cpu = {
|
||||||
|
"Cortex-M7FD": "Cortex-M7.fp.dp",
|
||||||
|
"Cortex-M7F": "Cortex-M7.fp.sp",
|
||||||
|
"Cortex-M33": "Cortex-M33.no_dsp",
|
||||||
|
"Cortex-M33F": "Cortex-M33.fp.no_dsp",
|
||||||
|
"Cortex-M33FD": "Cortex-M33.fp"}.get(core, core)
|
||||||
|
|
||||||
# flags_cmd are used only by our scripts, the project files have them already defined,
|
# flags_cmd are used only by our scripts, the project files have them already defined,
|
||||||
# using this flags results in the errors (duplication)
|
# using this flags results in the errors (duplication)
|
||||||
# asm accepts --cpu Core or --fpu FPU, not like c/c++ --cpu=Core
|
# asm accepts --cpu Core or --fpu FPU, not like c/c++ --cpu=Core
|
||||||
asm_flags_cmd = ["--cpu", cpuchoice]
|
asm_flags_cmd = ["--cpu", cpu]
|
||||||
# custom c flags
|
# custom c flags
|
||||||
c_flags_cmd = ["--cpu", cpuchoice]
|
c_flags_cmd = ["--cpu", cpu]
|
||||||
|
|
||||||
c_flags_cmd.extend([
|
c_flags_cmd.extend([
|
||||||
"--thumb", "--dlib_config", "DLib_Config_Full.h"
|
"--thumb", "--dlib_config", "DLib_Config_Full.h"
|
||||||
|
@ -71,22 +80,6 @@ class IAR(mbedToolchain):
|
||||||
cxx_flags_cmd = [
|
cxx_flags_cmd = [
|
||||||
"--c++", "--no_rtti", "--no_exceptions"
|
"--c++", "--no_rtti", "--no_exceptions"
|
||||||
]
|
]
|
||||||
if target.core == "Cortex-M7FD":
|
|
||||||
asm_flags_cmd += ["--fpu", "VFPv5"]
|
|
||||||
c_flags_cmd.append("--fpu=VFPv5")
|
|
||||||
elif target.core == "Cortex-M7F":
|
|
||||||
asm_flags_cmd += ["--fpu", "VFPv5_sp"]
|
|
||||||
c_flags_cmd.append("--fpu=VFPv5_sp")
|
|
||||||
elif target.core.startswith("Cortex-M33F"):
|
|
||||||
asm_flags_cmd += ["--fpu", "VFPv5_sp"]
|
|
||||||
c_flags_cmd.append("--fpu=VFPv5_sp")
|
|
||||||
|
|
||||||
# Create Secure library
|
|
||||||
if CORE_ARCH[target.core] == 8 and not target.core.endswith("-NS"):
|
|
||||||
self.flags["asm"] += ["--cmse"]
|
|
||||||
self.flags["common"] += ["--cmse"]
|
|
||||||
secure_file = join(build_dir, "cmse_lib.o")
|
|
||||||
self.flags["ld"] += ["--import_cmse_lib_out=%s" % secure_file]
|
|
||||||
|
|
||||||
IAR_BIN = join(TOOLCHAIN_PATHS['IAR'], "bin")
|
IAR_BIN = join(TOOLCHAIN_PATHS['IAR'], "bin")
|
||||||
main_cc = join(IAR_BIN, "iccarm")
|
main_cc = join(IAR_BIN, "iccarm")
|
||||||
|
|
Loading…
Reference in New Issue