We are using FreeRTOS on the Cortex-M7 in a IMX8MP.
It has worked fine for some time until we added math library calls. The math library will use the FPU. Now the M7 has started to crash.
We suspect that it is related to some interrupt handler messing up the math library call.
Reading on forums and source code, it looks like FPU support is available without any special setup in FreeRTOS (for Cortex-M7). Do we need to do something special to activate FPU support? Any other ideas of what might be wrong?
Environment:
Thanks for your reply @AldoG
We got the flags from the NXP example.
Looking more into the compiler flags and reference manual, we came to the conclusion that we should use the compiler flag -mfpu=fpv5-d16, since the IMX8MP has a Cortex-M7 with double precision. With that flag, all our target tests are working and math library calls etc works as expected.
However, should it work with the single precision flag?
With the single precision flag our FPU tests sometimes worked. Moving around the statements in the source code and/or adding debug code sometimes made it work. So it seems to be timing or code layout dependent.
It would be great if you added FPU examples.
Best regards,
Björn
Hello,
According to reference manual both are supported, so I would say it deppends on the application.
Regarding FPU example, I will pass your comments to team.
Best regards/Saludos,
Aldo.
Hello,
I see no problem with the link flags you have used, even in the SDK FreeRTOS we have the same flags set by default, please have a look at any example code flags.cmake
IF(NOT DEFINED FPU)
SET(FPU "-mfloat-abi=hard -mfpu=fpv5-sp-d16")
ENDIF()
Unfortunately we do not have any samples using FPU, not that I'm aware off.
Best regards/Saludos,
Aldo.