Skip to content

Commit 7005a67

Browse files
theotherjimmyDeepika
authored andcommitted
Enable uvision export for NS cores
1 parent ea6212a commit 7005a67

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

tools/export/cmsis/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def cpu_cmsis(cpu):
9797
cpu = cpu.replace("Cortex-","ARMC")
9898
cpu = cpu.replace("+","P")
9999
cpu = cpu.replace("F","_FP")
100+
cpu = cpu.replace("-NS", "")
100101
return cpu
101102

102103

tools/export/uvision/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def uv_debug(self):
3737
cpu = self.core.replace("Cortex-", "C")
3838
cpu = cpu.replace("+", "")
3939
cpu = cpu.replace("F", "")
40+
cpu = cpu.replace("-NS", "")
4041
cpu_flag = "p"+cpu
4142

4243
# Locations found in Keil_v5/TOOLS.INI
@@ -222,15 +223,14 @@ def generate(self):
222223
'device': DeviceUvision(self.target),
223224
}
224225
self.generated_files.append(ctx['linker_script'])
225-
core = ctx['device'].core
226-
ctx['cputype'] = core.rstrip("FD")
227-
if core.endswith("FD"):
226+
ctx['cputype'] = ctx['device'].core.rstrip("FD").replace("-NS", "")
227+
if ctx['device'].core.endswith("FD"):
228228
ctx['fpu_setting'] = 3
229-
elif core.endswith("F"):
229+
elif ctx['device'].core.endswith("F"):
230230
ctx['fpu_setting'] = 2
231231
else:
232232
ctx['fpu_setting'] = 1
233-
ctx['fputype'] = self.format_fpu(core)
233+
ctx['fputype'] = self.format_fpu(ctx['device'].core)
234234
ctx['armc6'] = int(self.TOOLCHAIN is 'ARMC6')
235235
ctx['toolchain_name'] = self.TOOLCHAIN_NAME
236236
ctx.update(self.format_flags())

tools/export/uvision/uvision.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
<AdsLsxf>1</AdsLsxf>
218218
<RvctClst>0</RvctClst>
219219
<GenPPlst>0</GenPPlst>
220-
<AdsCpuType>"{{device.core.replace("D","").replace("F","")}}"</AdsCpuType>
220+
<AdsCpuType>"{{cputype}}"</AdsCpuType>
221221
<RvctDeviceName></RvctDeviceName>
222222
<mOS>0</mOS>
223223
<uocRom>0</uocRom>

0 commit comments

Comments
 (0)