STM32H7 - SRAM issues - LOCAL VARIABLE ALLOCATED OVER GLOBAL VARIABLE ADDRESS
- August 26, 2020
- 13 replies
- 8133 views
Hi,
I am facing an problems that I have never seen before with local variables being allocated at the same addresses of global ones. In the attached image I show an example of a local variable with the address of another variable in the STEmwin library (WM_aCHWinLast).
The same has already occurred with other global variables, not only with STEmwin. I managed to find some and I was able to solve it by replacing vectors with pointers and allocating their size through customized malloc functions. All STemWin routines work perfectly, only generating the fault in specific executions sequences. The problem seems to be very localized in specific routines, but I don't understand the relationship since the variables are local and should only concern to HEAP memory, which is quite large 0xA000. Other global variables, besides STEwin also appeared with an overlapping address, but these did not generate hardfault.
After going through these routines, with overlapping variables, when executing GUI_Exec () the Hardfault is generated:
Bus, memory management or usage fault (FORCED)
Attempt to switch to invalid state (INVSTATE).
Any ideas or someone already had similar problems?
STM32H750 - Atollic TrueSTUDIO 9.3.0
Thank you in advance.

