Skip to content

Commit 8f138fc

Browse files
authored
Merge pull request #3355 from sarahmarshy/iar-no-cmsis
IAR export will not fail in the absence of a CMSIS pack
2 parents 89b56d6 + ab23c00 commit 8f138fc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/export/iar/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys
88

99
from tools.targets import TARGET_MAP
10-
from tools.export.exporters import Exporter
10+
from tools.export.exporters import Exporter, TargetNotSupportedException
1111
import json
1212
from tools.export.cmsis import DeviceCMSIS
1313
from multiprocessing import cpu_count
@@ -29,8 +29,7 @@ class IAR(Exporter):
2929
#iar_definitions.json
3030
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
3131
if hasattr(obj, 'device_name') and
32-
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains
33-
and DeviceCMSIS.check_supported(target)]
32+
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains]
3433

3534
SPECIAL_TEMPLATES = {
3635
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl',
@@ -106,14 +105,20 @@ def generate(self):
106105
#Optimizations
107106
if '-Oh' in flags['c_flags']:
108107
flags['c_flags'].remove('-Oh')
108+
109+
try:
110+
debugger = DeviceCMSIS(self.target).debug.replace('-','').upper()
111+
except TargetNotSupportedException:
112+
debugger = "CMSISDAP"
113+
109114
ctx = {
110115
'name': self.project_name,
111116
'groups': self.iar_groups(self.format_src(srcs)),
112117
'linker_script': self.format_file(self.resources.linker_script),
113118
'include_paths': [self.format_file(src) for src in self.resources.inc_dirs],
114119
'device': self.iar_device(),
115120
'ewp': sep+self.project_name + ".ewp",
116-
'debugger': DeviceCMSIS(self.target).debug.replace('-','').upper()
121+
'debugger': debugger
117122
}
118123
ctx.update(flags)
119124

0 commit comments

Comments
 (0)