|
11 | 11 | import re
|
12 | 12 |
|
13 | 13 | from tools.resources import FileType
|
14 |
| -from tools.targets import TARGET_MAP |
| 14 | +from tools.targets import TARGET_MAP, CORE_ARCH |
15 | 15 | from tools.export.exporters import Exporter
|
16 | 16 | from tools.export.cmsis import DeviceCMSIS
|
17 | 17 |
|
@@ -217,9 +217,12 @@ def format_src(self, srcs):
|
217 | 217 | @staticmethod
|
218 | 218 | def format_fpu(core):
|
219 | 219 | """Generate a core's FPU string"""
|
220 |
| - if core.endswith("FD"): |
| 220 | + fpu_core_name = core.replace("-NS", "").rstrip("E") |
| 221 | + if fpu_core_name.endswith("FD"): |
221 | 222 | return "FPU3(DFPU)"
|
222 |
| - elif core.endswith("F"): |
| 223 | + elif fpu_core_name.endswith("F"): |
| 224 | + if CORE_ARCH[core] == 8: |
| 225 | + return "FPU3(SFPU)" |
223 | 226 | return "FPU2"
|
224 | 227 | else:
|
225 | 228 | return ""
|
@@ -247,10 +250,11 @@ def generate(self):
|
247 | 250 | sct_path, dirname(sct_name))
|
248 | 251 | if ctx['linker_script'] != sct_path:
|
249 | 252 | self.generated_files.append(ctx['linker_script'])
|
250 |
| - ctx['cputype'] = ctx['device'].core.rstrip("FD").replace("-NS", "") |
251 |
| - if ctx['device'].core.endswith("FD"): |
| 253 | + fpu_included_core_name = ctx['device'].core.replace("-NS", "") |
| 254 | + ctx['cputype'] = fpu_included_core_name.rstrip("FDE") |
| 255 | + if fpu_included_core_name.endswith("FD"): |
252 | 256 | ctx['fpu_setting'] = 3
|
253 |
| - elif ctx['device'].core.endswith("F"): |
| 257 | + elif fpu_included_core_name.rstrip("E").endswith("F"): |
254 | 258 | ctx['fpu_setting'] = 2
|
255 | 259 | else:
|
256 | 260 | ctx['fpu_setting'] = 1
|
|
0 commit comments