Skip to content

IAR export will not fail in the absence of a CMSIS pack #3355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tools/export/iar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys

from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, TargetNotSupportedException
import json
from tools.export.cmsis import DeviceCMSIS
from multiprocessing import cpu_count
Expand All @@ -29,8 +29,7 @@ class IAR(Exporter):
#iar_definitions.json
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
if hasattr(obj, 'device_name') and
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains
and DeviceCMSIS.check_supported(target)]
obj.device_name in IAR_DEFS.keys() and "IAR" in obj.supported_toolchains]

SPECIAL_TEMPLATES = {
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl',
Expand Down Expand Up @@ -106,14 +105,20 @@ def generate(self):
#Optimizations
if '-Oh' in flags['c_flags']:
flags['c_flags'].remove('-Oh')

try:
debugger = DeviceCMSIS(self.target).debug.replace('-','').upper()
except TargetNotSupportedException:
debugger = "CMSISDAP"

ctx = {
'name': self.project_name,
'groups': self.iar_groups(self.format_src(srcs)),
'linker_script': self.format_file(self.resources.linker_script),
'include_paths': [self.format_file(src) for src in self.resources.inc_dirs],
'device': self.iar_device(),
'ewp': sep+self.project_name + ".ewp",
'debugger': DeviceCMSIS(self.target).debug.replace('-','').upper()
'debugger': debugger
}
ctx.update(flags)

Expand Down