@@ -41,7 +41,7 @@ class IAR(mbedToolchain):
41
41
"--diag_suppress=Pa050,Pa084,Pa093,Pa082" ],
42
42
'asm' : [],
43
43
'c' : [],
44
- 'cxx' : ["--c++" , "--no_rtti" , "--no_exceptions" , "-- guard_calls" ],
44
+ 'cxx' : ["--guard_calls" ],
45
45
'ld' : ["--skip_dynamic_initialization" , "--threaded_lib" ],
46
46
}
47
47
@@ -51,35 +51,43 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
51
51
cpuchoice = "Cortex-M7"
52
52
else :
53
53
cpuchoice = target .core
54
- self .flags ["common" ] += [
55
- "--cpu=%s" % cpuchoice , "--thumb" ,
56
- "--dlib_config" , join (IAR_PATH , "inc" , "c" , "DLib_Config_Full.h" ),
54
+ # flags_cmd are used only by our scripts, the project files have them already defined,
55
+ # using this flags results in the errors (duplication)
56
+ # asm accepts --cpu Core or --fpu FPU, not like c/c++ --cpu=Core
57
+ asm_flags_cmd = [
58
+ "--cpu" , cpuchoice
59
+ ]
60
+ # custom c flags
61
+ c_flags_cmd = [
62
+ "--cpu" , cpuchoice ,
63
+ "--thumb" , "--dlib_config" , join (IAR_PATH , "inc" , "c" , "DLib_Config_Full.h" )
64
+ ]
65
+ # custom c++ cmd flags
66
+ cxx_flags_cmd = [
67
+ "--c++" , "--no_rtti" , "--no_exceptions"
57
68
]
58
-
59
69
if target .core == "Cortex-M7F" :
60
- self .flags ["common" ].append ("--fpu=VFPv5_sp" )
70
+ asm_flags_cmd += ["--fpu" , "VFPv5_sp" ]
71
+ c_flags_cmd .append ("--fpu=VFPv5_sp" )
61
72
62
73
if "debug-info" in self .options :
63
- self . flags [ "common" ] .append ("-r" )
64
- self . flags [ "common" ] .append ("-On" )
74
+ c_flags_cmd .append ("-r" )
75
+ c_flags_cmd .append ("-On" )
65
76
else :
66
- self . flags [ "common" ] .append ("-Oh" )
77
+ c_flags_cmd .append ("-Oh" )
67
78
68
79
IAR_BIN = join (IAR_PATH , "bin" )
69
80
main_cc = join (IAR_BIN , "iccarm" )
70
81
71
- self .flags ["asm" ] += ["--cpu" , cpuchoice ]
72
- if target .core == "Cortex-M7F" :
73
- self .flags ["asm" ] += ["--fpu" , "VFPv5_sp" ]
74
- self .asm = [join (IAR_BIN , "iasmarm" )] + self .flags ["asm" ]
82
+ self .asm = [join (IAR_BIN , "iasmarm" )] + asm_flags_cmd + self .flags ["asm" ]
75
83
if not "analyze" in self .options :
76
84
self .cc = [main_cc ]
77
85
self .cppc = [main_cc ]
78
86
else :
79
87
self .cc = [join (GOANNA_PATH , "goannacc" ), '--with-cc="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
80
88
self .cppc = [join (GOANNA_PATH , "goannac++" ), '--with-cxx="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
81
- self .cc += self .flags ["common" ] + self .flags ["c" ]
82
- self .cppc += self .flags ["common" ] + self .flags ["cxx" ]
89
+ self .cc += self .flags ["common" ] + c_flags_cmd + self .flags ["c" ]
90
+ self .cppc += self .flags ["common" ] + c_flags_cmd + cxx_flags_cmd + self .flags ["cxx" ]
83
91
self .ld = join (IAR_BIN , "ilinkarm" )
84
92
self .ar = join (IAR_BIN , "iarchive" )
85
93
self .elf2bin = join (IAR_BIN , "ielftool" )
0 commit comments