Bus, memory management, or usage fault (FORCED)Extra details: Attempt to execute a coprocessor instruction (NOCP)
Bus, memory management, or usage fault (FORCED)Extra details: Attempt to execute a coprocessor instruction (NOCP)
Enabling the FPv4-SP-D16 FPU in the Assembler, Compiler, and C Linker settings with Hardware Implementation selected results in triggering a hard fault that leads to App_Fault_ISR.
What might be the cause of this problem?
Solution
The hard fault occurs because the FPU is not enabled. Add
SCB->CPACR |= (0xF << 20);
SCB->CPACR |= (0xF << 20);
in your initialization code to enable the FPU, and ensure your project settings in Atollic TrueSTUDIO are configured for FPU usage (