We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am using stm32h753 micro and i'd like to save heap in my external ram (0xC0000000).
When I debug my project an hard faulter handler occurs invocating the __main function after systeminit().
I write here my startup.s and my .sct file
//--------------
Stack_Size EQU 0x400
AREA STACK, NOINIT, READWRITE, ALIGN=3Stack_Mem SPACE Stack_Size__initial_sp
; <h> Heap Configuration; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>; </h>
Heap_Size EQU 0x00040000
AREA HEAP, NOINIT, READWRITE, ALIGN=3__heap_baseHeap_Mem SPACE Heap_Size__heap_limit
//---------------------------------------
LR_IROM1 0x8000000 0x00200000 { ; load region size_region ER_IROM1 0x8000000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM1 0x24000000 0x00080000 ; 512KB { startup.o (STACK) .ANY (+RW +ZI) } RW_IRAM2 0x30000000 0x00040000 ; 288KB { ;startup.o (HEAP) } RW_IRAM3 0x38000000 0x0010000 ; 64KB {
}
LR_ERAM 0xC0000000 0x2000000 { ER_ERAM1 0xC0000000 0x00040000 { startup.o (HEAP) }
ER_ERAM2 0xC1F00000 0x00100000 { }}
any idea?
thanks in advance
Yes, and you're not doing anything in there to turn on the clocks/memories. Doing it in main() is too late. CMSIS expects you to stand up the memory in SystemInit(), or assembler code in startup.s
The pins/memory are specific to your board.
See perhaps this for an example of how SDRAM is brought up, you'll need to tailor to YOUR hardware
STM32Cube_FW_H7_V1.5.0\Projects\STM32H747I-DISCO\Applications\STemWin\STemWin_animation\Common\Src\system_stm32h7xx.c