Skip to content

Commit 1e1ed26

Browse files
committed
[STM32F7] Allow IAR compilation
targets.py : add IAR for NUCLEO_F746ZG and DISCO_F746NG iar.py: in case of Cortex-M7F, change it into Cortex-M7 and add --fpu VFPv5_sp I have been confirmed that for Cortex-M4F we don't need to add the --fpu VFPv4_sp
1 parent 6501de9 commit 1e1ed26

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

workspace_tools/targets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def __init__(self):
846846
Target.__init__(self)
847847
self.core = "Cortex-M7F"
848848
self.extra_labels = ['STM', 'STM32F7', 'STM32F746', 'STM32F746ZG']
849-
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
849+
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "IAR"]
850850
self.detect_code = ["0816"]
851851
self.progen = {
852852
"target":"nucleo-f746zg",
@@ -1023,7 +1023,7 @@ def __init__(self):
10231023
Target.__init__(self)
10241024
self.core = "Cortex-M7F"
10251025
self.extra_labels = ['STM', 'STM32F7', 'STM32F746', 'STM32F746NG']
1026-
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"]
1026+
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "IAR"]
10271027
self.detect_code = ["0815"]
10281028
self.progen = {
10291029
"target":"disco-f746ng",

workspace_tools/toolchains/iar.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ class IAR(mbedToolchain):
3232

3333
def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False):
3434
mbedToolchain.__init__(self, target, options, notify, macros, silent, extra_verbose=extra_verbose)
35-
35+
if target.core == "Cortex-M7F":
36+
cpuchoice = "Cortex-M7"
37+
else:
38+
cpuchoice = target.core
3639
c_flags = [
37-
"--cpu=%s" % target.core, "--thumb",
40+
"--cpu=%s" % cpuchoice, "--thumb",
3841
"--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"),
3942
"-e", # Enable IAR language extension
4043
"--no_wrap_diagnostics",
@@ -45,6 +48,10 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
4548
"--diag_suppress=Pa050,Pa084,Pa093,Pa082",
4649
]
4750

51+
if target.core == "Cortex-M7F":
52+
c_flags.append("--fpu=VFPv5_sp")
53+
54+
4855
if "debug-info" in self.options:
4956
c_flags.append("-r")
5057
c_flags.append("-On")
@@ -53,7 +60,7 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
5360

5461
IAR_BIN = join(IAR_PATH, "bin")
5562
main_cc = join(IAR_BIN, "iccarm")
56-
self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", target.core]
63+
self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", cpuchoice]
5764
if not "analyze" in self.options:
5865
self.cc = [main_cc] + c_flags
5966
self.cppc = [main_cc, "--c++", "--no_rtti", "--no_exceptions"] + c_flags

0 commit comments

Comments
 (0)