Sterling
Sterling
DIIDevHeads IoT Integration Server
Created by Sterling on 8/29/2024 in #firmware-and-baremetal
what causes the STM32F429ZI to experience a hard error when attempting to cast a value into float?
Hi guys, what causes the STM32F429ZI to experience a hard error (App_Fault_ISR) when attempting to cast a value into float? I have come across a problem while using Atollic TrueSTUDIO on an STM32F429ZI Nucleo board. Below is my code:
CPU_FP32 speed;
CPU_INT32U val = (CPU_INT32U)(0x20u >> 4u);
speed = (CPU_FP32)val;
CPU_FP32 speed;
CPU_INT32U val = (CPU_INT32U)(0x20u >> 4u);
speed = (CPU_FP32)val;
The crash occurs at this assembly instruction:
080026fa: ldr r3, [r7, #4]
080026fc: vmov s15, r3 // <---- Crash occurs here
080026fa: ldr r3, [r7, #4]
080026fc: vmov s15, r3 // <---- Crash occurs here
The Hard Fault Detected window shows:
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?
5 replies