make/cortexm: fix -mfpu flag value for CortexM7#13021
make/cortexm: fix -mfpu flag value for CortexM7#13021vincent-d merged 1 commit intoRIOT-OS:masterfrom
Conversation
Use single precision, like with M4 instead of double precision
fjmolinas
left a comment
There was a problem hiding this comment.
Tested it fixes the issue on nucleo-f7426zg:
Details
INFO:nucleo-f746zg:Saving toolchain
INFO:nucleo-f746zg.tests/bloom_bytes:Board supported: True
INFO:nucleo-f746zg.tests/bloom_bytes:Board has enough memory: True
INFO:nucleo-f746zg.tests/bloom_bytes:Application has test: True
INFO:nucleo-f746zg.tests/bloom_bytes:Run compilation
INFO:nucleo-f746zg.tests/bloom_bytes:Run test
INFO:nucleo-f746zg.tests/bloom_bytes:Run test.flash
INFO:nucleo-f746zg.tests/bloom_bytes:Success
INFO:nucleo-f746zg.tests/float:Board supported: True
INFO:nucleo-f746zg.tests/float:Board has enough memory: True
INFO:nucleo-f746zg.tests/float:Application has test: True
INFO:nucleo-f746zg.tests/float:Run compilation
INFO:nucleo-f746zg.tests/float:Run test
INFO:nucleo-f746zg.tests/float:Run test.flash
INFO:nucleo-f746zg.tests/float:Success
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Board supported: True
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Board has enough memory: True
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Application has test: True
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Run compilation
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Run test
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Run test.flash
INFO:nucleo-f746zg.tests/pkg_cn-cbor:Success
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Board supported: True
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Board has enough memory: True
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Application has test: True
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Run compilation
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Run test
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Run test.flash
INFO:nucleo-f746zg.tests/pkg_lora-serialization:Success
INFO:nucleo-f746zg.tests/pkg_ubasic:Board supported: True
INFO:nucleo-f746zg.tests/pkg_ubasic:Board has enough memory: True
INFO:nucleo-f746zg.tests/pkg_ubasic:Application has test: True
INFO:nucleo-f746zg.tests/pkg_ubasic:Run compilation
INFO:nucleo-f746zg.tests/pkg_ubasic:Run test
INFO:nucleo-f746zg.tests/pkg_ubasic:Run test.flash
INFO:nucleo-f746zg.tests/pkg_ubasic:Success
INFO:nucleo-f746zg.tests/rng:Board supported: True
INFO:nucleo-f746zg.tests/rng:Board has enough memory: True
INFO:nucleo-f746zg.tests/rng:Application has test: True
INFO:nucleo-f746zg.tests/rng:Run compilation
INFO:nucleo-f746zg.tests/rng:Run test
INFO:nucleo-f746zg.tests/rng:Run test.flash
INFO:nucleo-f746zg.tests/rng:Success
INFO:nucleo-f746zg.tests/unittests:Board supported: True
INFO:nucleo-f746zg.tests/unittests:Board has enough memory: True
INFO:nucleo-f746zg.tests/unittests:Application has test: True
INFO:nucleo-f746zg.tests/unittests:Run compilation
INFO:nucleo-f746zg.tests/unittests:Run test
INFO:nucleo-f746zg.tests/unittests:Run test.flash
INFO:nucleo-f746zg.tests/unittests:Success
INFO:nucleo-f746zg:Tests successful
|
This is an incomplete fix, the issue although present with stm32f746 is not with all cortexm7, it depends on their FPU precision support ( see https://www.st.com/en/microcontrollers-microprocessors/stm32f7-series.html), e.g.:
Passes. |
|
Thanks for merging @vincent-d! @fjmolinas, the proposed fix is still valid for nucleo-f767zi which has double precision. An enhancement could be to add a configuration variable to enable double precision when possible. |
Contribution description
This PR fixes an issue when using FPU on Cortex-M7 CPU by using a different flag to use single precision instead of double precision (this is also the case with M4).
See https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html and search for
-mfpu=to find available options.From my tests (on nucleo-f746zg), this PR fixes #12286.
Testing procedure
Run
compile_and_test_for_board.pyon a F7 board:With this PR, you get the following behavior with tests that failed in #12286:
Details
Issues/PRs references
Fixes #12286