Skip to content

Commit

Permalink
Change FPU flags to use single precision FPU (#13)
Browse files Browse the repository at this point in the history
The Cortex-M33F has a single precision fpu, thus the linker fpu settings need to be set to -mfpu=fpv-sp-d16. Otherwise all calls to the floating point abi will lead to a crash.
  • Loading branch information
MyselfAndJo committed Sep 21, 2023
1 parent 494b0de commit 55b8552
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,10 @@ def load_flags(filename):
# Add FPU flags
#

fpv_version = "4-sp"
if board.id == "portenta_c33":
fpv_version = "5"

env.Append(
LINKFLAGS=[
"-mfloat-abi=hard",
"-mfpu=fpv%s-d16" % fpv_version
"-mfpu=fpv%s-sp-d16" % ("5" if board.id == "portenta_c33" else "4"),
]
)

Expand Down

0 comments on commit 55b8552

Please sign in to comment.