New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flags specified in platformio.ini build_flags variable not applied to all necessary steps in the build process #594
Comments
Hi @apvanzanten! Which framework are you going to use? |
I am currently using spl. However for the test case I configured it for mbed because that was the default and because it gave a cleaner and simpler test case. I slightly modified the test case so it works for spl and put it in a separate branch of my repo. |
I can suggest such workaround: [env:disco_f407vg]
platform = ststm32
framework = spl
board = disco_f407vg
build_flags = -mthumb -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16
extra_script = update_link_flags.py update_link_flags.py: # Custom settings, as referred to as "extra_script" in platformio.ini
#
# See http://docs.platformio.org/en/latest/projectconf.html#extra-script
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
env.Append(
LINKFLAGS=[
"-mthumb",
"-march=armv7e-m",
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16"
]
) |
That works a treat. Thanks! |
Thanks a lot for the report! Happy Coding! Please give a star ⭐ for our repositories:
Thanks! |
Hello, I have the same problem but I'm using Platform: stm32f0discovery. |
Hi. Why is this closed? I'm having the same problem with stm32f407 and it does not seem that this is fixed. |
@positron96 what is your platformio.ini? |
Something in the lines of this:
|
Sorry, this is a valid solution at this time. We will work on #2144 |
Configuration
PlatformIO version 2.8.6
Platform: ststm32 - disco_f407vg
Description of problem
When supplying platformio with flags via the build_flags variable in the platformio.ini file, these flags are applied only to the compilation of the user-supplied source (src and lib folder) but not in the final linkage.
Steps to Reproduce
I have set up a test case here on github, the readme on it explains how to use it (it is very simple, basically just clone and platformio run).
Actual Results
The test case tries to build using flags for hardware floating point, which are applied as expected on the compilation of the main.c file, but then not anywhere else in the build process, this causes problems when the linker tries to link the hard-float compiled main.o to the soft-float compiled firmware.elf.
Expected Results
For the build flags to be applied properly and the project to build without errors.
The text was updated successfully, but these errors were encountered: