Skip to content

Commit e8239e0

Browse files
committed
[Cortex_M7] fpu with single/double precision - bugfix and extension
- creating new core name Cortex_M7F_DP for a target with a double precision fpu - adding new core name to arm.py to set compiler/linker flags to a double precision fpu when configured in target.json - up to now: gcc wrote flag for a double precision fpu -> target with STM32F746 didn't run when using double variables - mcu has only single precision fpu - changing gcc.py to use single precision for Cortex-M7 und double precision for Cortex_M7F_DP tested with NUCLEO_F746, NUCLEO_F767 and build.py+make.py and exporting with project.py + compiling/flashing - iar.py need a similar extention - I didn't change that yet because - did not run at the moment - python exception - currently worked on in PR #1948
1 parent b885ff8 commit e8239e0

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

hal/targets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@
792792
},
793793
"NUCLEO_F767ZI": {
794794
"inherits": ["Target"],
795-
"core": "Cortex-M7F",
795+
"core": "Cortex-M7F_DP",
796796
"extra_labels": ["STM", "STM32F7", "STM32F767", "STM32F767ZI"],
797797
"supported_toolchains": ["ARM", "uARM", "GCC_ARM"],
798798
"default_toolchain": "ARM",

tools/targets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"Cortex-M4F" : ["M4", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M4"],
2626
"Cortex-M7" : ["M7", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M7"],
2727
"Cortex-M7F" : ["M7", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M7"],
28+
"Cortex-M7F_DP" : ["M7", "CORTEX_M", "RTOS_M4_M7", "LIKE_CORTEX_M7"],
2829
"Cortex-A9" : ["A9", "CORTEX_A", "LIKE_CORTEX_A9"]
2930
}
3031

tools/toolchains/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ class mbedToolchain:
219219
"Cortex-M4F" : ["__CORTEX_M4", "ARM_MATH_CM4", "__FPU_PRESENT=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
220220
"Cortex-M7" : ["__CORTEX_M7", "ARM_MATH_CM7", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
221221
"Cortex-M7F" : ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
222+
"Cortex-M7F_DP" : ["__CORTEX_M7", "ARM_MATH_CM7", "__FPU_PRESENT=1", "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
222223
"Cortex-A9" : ["__CORTEX_A9", "ARM_MATH_CA9", "__FPU_PRESENT", "__CMSIS_RTOS", "__EVAL", "__MBED_CMSIS_RTOS_CA9"],
223224
}
224225

tools/toolchains/arm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
5151
cpu = "Cortex-M4.fp"
5252
elif target.core == "Cortex-M7F":
5353
cpu = "Cortex-M7.fp.sp"
54+
elif target.core == "Cortex-M7F_DP":
55+
cpu = "Cortex-M7.fp.dp"
5456
else:
5557
cpu = target.core
5658

tools/toolchains/gcc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
5252
cpu = "cortex-m4"
5353
elif target.core == "Cortex-M7F":
5454
cpu = "cortex-m7"
55+
elif target.core == "Cortex-M7F_DP":
56+
cpu = "cortex-m7"
5557
else:
5658
cpu = target.core.lower()
5759

@@ -62,7 +64,12 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
6264
if target.core == "Cortex-M4F":
6365
self.cpu.append("-mfpu=fpv4-sp-d16")
6466
self.cpu.append("-mfloat-abi=softfp")
67+
6568
elif target.core == "Cortex-M7F":
69+
self.cpu.append("-mfpu=fpv5-sp-d16")
70+
self.cpu.append("-mfloat-abi=softfp")
71+
72+
elif target.core == "Cortex-M7F_DP":
6673
self.cpu.append("-mfpu=fpv5-d16")
6774
self.cpu.append("-mfloat-abi=softfp")
6875

0 commit comments

Comments
 (0)