2025-07-13 12:32 AM
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.
2025-07-13 1:00 AM
From where you have idea this works? Minimum is special init code, that block reinit external memorry...
2025-07-13 1:05 AM - edited 2025-07-13 1:06 AM
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.
2025-07-13 1:22 AM
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"