cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader/BootROM Cannot Execute App Code on SDRAM Address

EmirhanS
Associate

Hello,
I am currently working on a bootloader code. I successfully managed to execute the app code by copying to the RAM address (0x20000000). However, whenever I try to copy the app code to SDRAM (0xC0000000) instead of RAM, bootloader never executes the app code. 

In the linker script file of my app, I follow the same process with the "RAM Version" of the code: I used SDRAM address for all sectors (.data, .text, .bss...). 

My jump code is basically like:

    uint32_t app_sp = *((volatile uint32_t*)APP_SDRAM_ADDRESS);
    uint32_t app_pc = *((volatile uint32_t*)(APP_SDRAM_ADDRESS + 4));
    SCB->VTOR = APP_SDRAM_ADDRESS;
    __set_MSP(app_sp);
    ((void (*)(void))app_pc)();

 
Thanks.

3 REPLIES 3
MM..1
Chief III

From where you have idea this works? Minimum is special init code, that block reinit external memorry...

Hi,
I appreciate your answer. Maybe it is because of the lack of my experience but I did not understand your answer well:
"that block reinit external memorry."
Thanks.

Simply internal RAM works after MCU is powered, but FMC require sw init, and this init is i hope once in your bootlodaer code, but if exist in app code too = reinit = fail run same code in SDRAM

Try chatgpt ask "stm32f7 condition to run code in sdram"