Skip to main content
Associate III
May 16, 2025
Solved

How to boot code from Sector 5 on Nucleo-F446RE after reset?

  • May 16, 2025
  • 4 replies
  • 756 views

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:

  1. How can I make the STM32F446RE boot from Sector 5 after every reset?

  2. Is it necessary to place a custom bootloader at Sector 0 that manually jumps to the application code at Sector 5?

  3. Is there any other way?

Any guidance would be very helpful.

Thanks!

Best answer by STOne-32

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

4 replies

mƎALLEm
Technical Moderator
May 16, 2025

Hello,

Did you set the vector table according to that new address?

Did you update the linker file according to that new address?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate III
May 16, 2025

Yes i done these steps:

Shreayas_Acharaya_0-1747401284262.png

Shreayas_Acharaya_1-1747401289516.png

 

mƎALLEm
Technical Moderator
May 16, 2025

And if you use the default address: 0x0800000, do you have the same behavior?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Associate III
May 16, 2025

No, with 0x0800000 it works fine.

Associate III
May 17, 2025

FYI:
I placed the code succesfully @sector5 (i.e., 0x08020000) , but it runs only once , after reset it doesn't run.

Shreayas_Acharaya_0-1747466820562.png

 

STOne-32
STOne-32Best answer
Technical Moderator
May 17, 2025

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