2025-05-16 4:42 AM - last edited on 2025-05-16 10:34 AM by mƎALLEm
I'm using a Nucleo-F446RE board and have successfully flashed my application code to Sector 5 of the internal flash memory. The code runs correctly right after flashing, but it does not run after a reset or power cycle.
It seems the MCU still boots from the default start address (Sector 0), and doesn't automatically jump to Sector 5.
:question_mark:My main questions are:
How can I make the STM32F446RE boot from Sector 5 after every reset?
Is it necessary to place a custom bootloader at Sector 0 that manually jumps to the application code at Sector 5?
Is there any other way?
Any guidance would be very helpful.
Thanks!
Solved! Go to Solution.
2025-05-17 2:11 AM - edited 2025-05-17 4:55 AM
Dear @Shreayas_Acharaya ,
You can not boot at sector5 on this product, impossible , it is hardware coded to either Flash sector 0 or ST system memory boot .
So, if you want to do that , you need to program a Jump code from Sector 0 to sector 5, therefore programming First boot sector at 0x0800-0000. When using debugger , the debug is forcing that jump automatically but this will not happen at standalone after cold reset.
Cheers,
STOne-32
2025-05-16 4:53 AM
Hello,
Did you set the vector table according to that new address?
Did you update the linker file according to that new address?
2025-05-16 6:15 AM
Yes i done these steps:
2025-05-16 6:26 AM
And if you use the default address: 0x0800000, do you have the same behavior?
2025-05-16 9:40 AM
No, with 0x0800000 it works fine.
2025-05-16 11:44 PM - edited 2025-05-17 12:23 AM
Another thing to note:
In debug mode, when I hit "Resume", the code runs as expected.
But if I hit "Reset", it doesn't run and shows a message like “No resource preset” or gets stuck.
2025-05-17 12:27 AM
FYI:
I placed the code succesfully @sector5 (i.e., 0x08020000) , but it runs only once , after reset it doesn't run.
2025-05-17 2:11 AM - edited 2025-05-17 4:55 AM
Dear @Shreayas_Acharaya ,
You can not boot at sector5 on this product, impossible , it is hardware coded to either Flash sector 0 or ST system memory boot .
So, if you want to do that , you need to program a Jump code from Sector 0 to sector 5, therefore programming First boot sector at 0x0800-0000. When using debugger , the debug is forcing that jump automatically but this will not happen at standalone after cold reset.
Cheers,
STOne-32