Skip to content

Commit 11702d1

Browse files
committed
Enable uvision export for NS cores
1 parent 5e9ac75 commit 11702d1

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
@@ -98,6 +98,7 @@ def cpu_cmsis(cpu):
9898
cpu = cpu.replace("Cortex-","ARMC")
9999
cpu = cpu.replace("+","P")
100100
cpu = cpu.replace("F","_FP")
101+
cpu = cpu.replace("-NS", "")
101102
return cpu
102103

103104

tools/export/uvision/__init__.py

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

4344
# Locations found in Keil_v5/TOOLS.INI
@@ -231,15 +232,14 @@ def generate(self):
231232
sct_path, dirname(sct_name))
232233
if ctx['linker_script'] != sct_path:
233234
self.generated_files.append(ctx['linker_script'])
234-
core = ctx['device'].core
235-
ctx['cputype'] = core.rstrip("FD")
236-
if core.endswith("FD"):
235+
ctx['cputype'] = ctx['device'].core.rstrip("FD").replace("-NS", "")
236+
if ctx['device'].core.endswith("FD"):
237237
ctx['fpu_setting'] = 3
238-
elif core.endswith("F"):
238+
elif ctx['device'].core.endswith("F"):
239239
ctx['fpu_setting'] = 2
240240
else:
241241
ctx['fpu_setting'] = 1
242-
ctx['fputype'] = self.format_fpu(core)
242+
ctx['fputype'] = self.format_fpu(ctx['device'].core)
243243
ctx['armc6'] = int(self.TOOLCHAIN is 'ARMC6')
244244
ctx['toolchain_name'] = self.TOOLCHAIN_NAME
245245
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)