2020-11-20 07:27 AM
2020-11-20 09:44 AM
The floating point implementation for the compiler to use is passed as an argument. Passing -mfloat-abi=soft will prevent it from generating hardware FPU instructions. This is done within project settings in STM32CubeIDE.
Leaving CPACR alone will keep the FPU off. Enabling it is done within SystemInit if you have the appropriate defines enabled.
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << (10*2))|(3UL << (11*2))); /* set CP10 and CP11 Full Access */
#endif
/* Reset the RCC clock configuration to the default reset state ------------*/
2020-11-20 10:09 AM
Just curious, is there any gcc option to completely prevent any floating point code generation at all -- maybe throw an error or warning? It looks like some ARM architectures support a -march=<blah>+nofp to do that.
Thank you,
--b
2020-11-20 11:18 AM