I am developing an application with STM32L476 (without FreeRTOS). I am using SW4STM32 and STM32CubeMx. I am using SDMMC with Fatfs in my application. Currently I am seeing a hardfault when I free memory.
These are my stack and heap details as per linker file
/* Highest address of the user mode stack */
_estack = 0x20018000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x7E20; /* required amount of heap */
_Min_Stack_Size = 0x1FA0; /* required amount of stack */
0x20003248
is the address at which crash occurs (is the address which I am freeing)
I tried to debug the issue by following this link Cortex-M3 Hard Fault - find cause
This is what I get at hardfault:
SCB->HFSR = 0x40000000
Forced Hard Fault
SCB->CFSR = 0x00008200
but I couldnt conclude anything
BFARVALID
andPRECISERR
set. Read the descriptions and then examine theBFAR
register value. – kkrambo