STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fpu_link_flags.py
Go to the documentation of this file.
1# PlatformIO extra script for env:flight.
2#
3# The STM32H723 has a double-precision FPU, and CubeMX builds with the
4# hard-float ABI (-mfpu=fpv5-d16 -mfloat-abi=hard). build_flags only reach the
5# compiler, so the linker would pick the soft-float C library and the link
6# would fail on mixed ABIs. This passes the same flags to the assembler and the
7# linker, as CubeMX's cmake/gcc-arm-none-eabi.cmake does. It also links
8# newlib-nano (--specs=nano.specs) like that file: the full newlib's printf
9# family alone is ~29 KB of flash.
10Import("env") # noqa: F821 (provided by PlatformIO/SCons)
11
12FPU = ["-mfpu=fpv5-d16", "-mfloat-abi=hard"]
13
14# C++ (Ryan's radio code in src/, app/*.cpp): no exceptions, no RTTI, no
15# guard locks around function statics; nothing here needs them.
16env.Append(CXXFLAGS=["-fno-exceptions", "-fno-rtti", "-fno-threadsafe-statics"])
17
18env.Append(
19 ASFLAGS=FPU,
20 LINKFLAGS=FPU + ["--specs=nano.specs", "-Wl,--print-memory-usage"],
21) # noqa: F821