7
7
import sys
8
8
9
9
from tools .targets import TARGET_MAP
10
- from tools .export .exporters import Exporter
10
+ from tools .export .exporters import Exporter , TargetNotSupportedException
11
11
import json
12
12
from tools .export .cmsis import DeviceCMSIS
13
13
from multiprocessing import cpu_count
@@ -29,8 +29,7 @@ class IAR(Exporter):
29
29
#iar_definitions.json
30
30
TARGETS = [target for target , obj in TARGET_MAP .iteritems ()
31
31
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 ]
34
33
35
34
SPECIAL_TEMPLATES = {
36
35
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl' ,
@@ -106,14 +105,20 @@ def generate(self):
106
105
#Optimizations
107
106
if '-Oh' in flags ['c_flags' ]:
108
107
flags ['c_flags' ].remove ('-Oh' )
108
+
109
+ try :
110
+ debugger = DeviceCMSIS (self .target ).debug .replace ('-' ,'' ).upper ()
111
+ except TargetNotSupportedException :
112
+ debugger = "CMSISDAP"
113
+
109
114
ctx = {
110
115
'name' : self .project_name ,
111
116
'groups' : self .iar_groups (self .format_src (srcs )),
112
117
'linker_script' : self .format_file (self .resources .linker_script ),
113
118
'include_paths' : [self .format_file (src ) for src in self .resources .inc_dirs ],
114
119
'device' : self .iar_device (),
115
120
'ewp' : sep + self .project_name + ".ewp" ,
116
- 'debugger' : DeviceCMSIS ( self . target ). debug . replace ( '-' , '' ). upper ()
121
+ 'debugger' : debugger
117
122
}
118
123
ctx .update (flags )
119
124
0 commit comments