AnsweredAssumed Answered

Valid Stack Pointer Regions for STM32 MCU

Question asked by Michael Steinecke on Oct 30, 2015
Latest reply on Oct 30, 2015 by Clive One

since a week, I always get a HardFault in the line "bx R14" of the FreeRTOS 8.2.2 assembler routine vPortSVCHandler on a STM32F103zg.
"Attempt to do exception with bad value in EXEC_RETURN number (INVPC)"

I think it is related to the value of PSP at that moment (0x64006420), which is the location of the stack of the IDLE task. I have relocated the entire task heap to the "External RAM" region.  When I place the heap in the SRAM region instead, the exception doesn't occurs. The downside is, I don' have enough memory in the SRAM region for the entire heap.

My problem is, I have relocated the heap to the External RAM more then a year ago and now out of nowhere I get that fault. Also the same works with a STM32F429zg very fine. In the ARM reference manual, I can't find a difference between both MCU generations regarding the memory region. In both there is no mention like the SRAM "You can also put code here.".

So, is the PSP really the cause of my fault?