Answer the question
In order to leave comments, you need to log in
How to properly use multiple memory sectors on a microcontroller?
Good day.
The question itself arose due to the fact that my program for the stm32f429ZITx microcontroller crashes into HardFault_Handler simply when adding a few additional variables, not from the start, but during work, when calling the emwin and freeRTOS functions.
With memory, this is the case:
Standard microcontroller RAM (address 0x20000000)
CCMRAM microcontroller memory (address 0x10000000)
AND SDRAM connected via FMC and located in the same address space with the rest of the memory that I use to control the display via LTDC. But the SDRAM is much larger than the display needs. (0xD0000000)
I went beyond the boundaries of the main memory a long time ago and ordered the linker to use CCMRAM.
Registered in the scatter file keil 5 like this
Answer the question
In order to leave comments, you need to log in
I'm not familiar with kale, but I'll try to help.
*) The stack is definitely not worth doing in one memory. Especially if they are different types of memory. To say for sure, you need to carefully read the descriptions on the MK.
*) Segment code/data via attributes. For gcc, look at examples of how it is done, I think - there will be something close.
*) You can catch HardFault for other reasons as well. See the contents of the stack after the "trap" is triggered and what is above. It's not easy, but other paths either rely on experience or are even more time consuming.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question