Skip to main content
EmirhanS
Associate
Question

Bootloader/BootROM Cannot Execute App Code on SDRAM Address

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.

This topic has been closed for replies.

3 replies

MM..1
Super User

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

EmirhanS
EmirhanSAuthor
Associate

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.

MM..1
Super User

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"