From 1e1ed26327640630f233fbee0033c788d824d54c Mon Sep 17 00:00:00 2001 From: adustm Date: Thu, 10 Mar 2016 17:07:16 +0100 Subject: [PATCH 1/2] [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 --- workspace_tools/targets.py | 4 ++-- workspace_tools/toolchains/iar.py | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 4c9cf9d6d0..6ea469b1a6 100755 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -846,7 +846,7 @@ class NUCLEO_F746ZG(Target): Target.__init__(self) self.core = "Cortex-M7F" self.extra_labels = ['STM', 'STM32F7', 'STM32F746', 'STM32F746ZG'] - self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"] + self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "IAR"] self.detect_code = ["0816"] self.progen = { "target":"nucleo-f746zg", @@ -1023,7 +1023,7 @@ class DISCO_F746NG(Target): Target.__init__(self) self.core = "Cortex-M7F" self.extra_labels = ['STM', 'STM32F7', 'STM32F746', 'STM32F746NG'] - self.supported_toolchains = ["ARM", "uARM", "GCC_ARM"] + self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "IAR"] self.detect_code = ["0815"] self.progen = { "target":"disco-f746ng", diff --git a/workspace_tools/toolchains/iar.py b/workspace_tools/toolchains/iar.py index 594391f1bb..3004c16856 100644 --- a/workspace_tools/toolchains/iar.py +++ b/workspace_tools/toolchains/iar.py @@ -32,9 +32,12 @@ class IAR(mbedToolchain): def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False): mbedToolchain.__init__(self, target, options, notify, macros, silent, extra_verbose=extra_verbose) - + if target.core == "Cortex-M7F": + cpuchoice = "Cortex-M7" + else: + cpuchoice = target.core c_flags = [ - "--cpu=%s" % target.core, "--thumb", + "--cpu=%s" % cpuchoice, "--thumb", "--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"), "-e", # Enable IAR language extension "--no_wrap_diagnostics", @@ -45,6 +48,10 @@ class IAR(mbedToolchain): "--diag_suppress=Pa050,Pa084,Pa093,Pa082", ] + if target.core == "Cortex-M7F": + c_flags.append("--fpu=VFPv5_sp") + + if "debug-info" in self.options: c_flags.append("-r") c_flags.append("-On") @@ -53,7 +60,7 @@ class IAR(mbedToolchain): IAR_BIN = join(IAR_PATH, "bin") main_cc = join(IAR_BIN, "iccarm") - self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", target.core] + self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", cpuchoice] if not "analyze" in self.options: self.cc = [main_cc] + c_flags self.cppc = [main_cc, "--c++", "--no_rtti", "--no_exceptions"] + c_flags From 52c70867e63bc13808ad9df05821183e10e6aac6 Mon Sep 17 00:00:00 2001 From: adustm Date: Thu, 10 Mar 2016 18:24:10 +0100 Subject: [PATCH 2/2] [STM32F7] fix typo in targets.py + remove tabs in iar.py --- workspace_tools/targets.py | 2 +- workspace_tools/toolchains/iar.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 6ea469b1a6..646ee7ea9c 100755 --- a/workspace_tools/targets.py +++ b/workspace_tools/targets.py @@ -851,7 +851,7 @@ class NUCLEO_F746ZG(Target): self.progen = { "target":"nucleo-f746zg", "iar": { - "template": [os.path.join(os.path.dirname(__file__), 'export', 'iar_nucleo_f746cg.ewp.tmpl')], + "template": [os.path.join(os.path.dirname(__file__), 'export', 'iar_nucleo_f746zg.ewp.tmpl')], } } diff --git a/workspace_tools/toolchains/iar.py b/workspace_tools/toolchains/iar.py index 3004c16856..5e4d1e8070 100644 --- a/workspace_tools/toolchains/iar.py +++ b/workspace_tools/toolchains/iar.py @@ -33,9 +33,9 @@ class IAR(mbedToolchain): def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False): mbedToolchain.__init__(self, target, options, notify, macros, silent, extra_verbose=extra_verbose) if target.core == "Cortex-M7F": - cpuchoice = "Cortex-M7" + cpuchoice = "Cortex-M7" else: - cpuchoice = target.core + cpuchoice = target.core c_flags = [ "--cpu=%s" % cpuchoice, "--thumb", "--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"),