@@ -38,11 +38,9 @@ class IAR(mbedToolchain):
38
38
# Pa093: Implicit conversion from float to integer (ie: wait_ms(85.4) -> wait_ms(85))
39
39
# Pa082: Operation involving two values from two registers (ie: (float)(*obj->MR)/(float)(LPC_PWM1->MR0))
40
40
"-e" , # Enable IAR language extension
41
- "--diag_suppress=Pa050,Pa084,Pa093,Pa082" ,
42
- "--thumb" ,
43
- "--dlib_config" , join (IAR_PATH , "inc" , "c" , "DLib_Config_Full.h" )],
41
+ "--diag_suppress=Pa050,Pa084,Pa093,Pa082" ],
44
42
'asm' : [],
45
- 'c' : [],
43
+ 'c' : ["--vla" ],
46
44
'cxx' : ["--c++" , "--no_rtti" , "--no_exceptions" , "--guard_calls" ],
47
45
'ld' : ["--skip_dynamic_initialization" , "--threaded_lib" ],
48
46
}
@@ -53,31 +51,35 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
53
51
cpuchoice = "Cortex-M7"
54
52
else :
55
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" ),
57
+ ]
56
58
57
59
if target .core == "Cortex-M7F" :
58
60
self .flags ["common" ].append ("--fpu=VFPv5_sp" )
59
61
60
- optimization = []
61
62
if "debug-info" in self .options :
62
- optimization .append ("-r" )
63
- optimization .append ("-On" )
63
+ self . flags [ "common" ] .append ("-r" )
64
+ self . flags [ "common" ] .append ("-On" )
64
65
else :
65
- optimization .append ("-Oh" )
66
+ self . flags [ "common" ] .append ("-Oh" )
66
67
67
68
IAR_BIN = join (IAR_PATH , "bin" )
68
69
main_cc = join (IAR_BIN , "iccarm" )
69
70
71
+ self .flags ["asm" ] += ["--cpu" , cpuchoice ]
70
72
if target .core == "Cortex-M7F" :
71
73
self .flags ["asm" ] += ["--fpu" , "VFPv5_sp" ]
72
- self .asm = [join (IAR_BIN , "iasmarm" )] + self .flags ["asm" ] + [ "--cpu=%s" % cpuchoice ]
74
+ self .asm = [join (IAR_BIN , "iasmarm" )] + self .flags ["asm" ]
73
75
if not "analyze" in self .options :
74
76
self .cc = [main_cc ]
75
77
self .cppc = [main_cc ]
76
78
else :
77
79
self .cc = [join (GOANNA_PATH , "goannacc" ), '--with-cc="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
78
80
self .cppc = [join (GOANNA_PATH , "goannac++" ), '--with-cxx="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
79
- self .cc += self .flags ["common" ] + self .flags ["c" ] + [ "--cpu=%s" % cpuchoice ] + optimization
80
- self .cppc += self .flags ["common" ] + self .flags ["cxx" ] + [ "--cpu=%s" % cpuchoice ] + optimization
81
+ self .cc += self .flags ["common" ] + self .flags ["c" ]
82
+ self .cppc += self .flags ["common" ] + self .flags ["cxx" ]
81
83
self .ld = join (IAR_BIN , "ilinkarm" )
82
84
self .ar = join (IAR_BIN , "iarchive" )
83
85
self .elf2bin = join (IAR_BIN , "ielftool" )
0 commit comments