Lately I've been getting randomly occuring hardfault in my code during heavy BLE traffic and Sensor data collection times. From the hardfault_implementation.c loop I see the following information: Pc: 0x2000feb8 LR: 0xfffffffd PSR: Carry flag set, Busfault, Thread mode
The PC value when cross referenced with the .MAP file I see the following: 0x2000feb8 __StackTop = (ORIGIN (RAM) + 0xd000) 0x2000f6b8 __StackLimit = (__StackTop - SIZEOF (.stack_dummy)) 0x2000feb8 PROVIDE (__stack, __StackTop) 0x00000001 ASSERT ((__StackLimit >= __HeapLimit), region RAM overflowed with stack)
Seems to me to be either a Heap issue or a corrupted Stack. What are some potential causes of this? The error occurs at random times, between 4mins and 30mins of heavy stream/sensor capture duration. Are there any other registers I can look at to help trace the root cause of this?
FYI: Using SDK 12.3 (with SDK 13 freertos files), I am trigger an HVX inside an xTimer handler every ~10msec where I'm grabbing sensor data (variable read from a separate thread).