cancel
Showing results for 
Search instead for 
Did you mean: 

It is possible to set two vector table in same flash

jackiee
Associate

I am implementing a dual-firmware architecture on an STM32 microcontroller that does not natively support dual-bank flash. In this setup, I have partitioned the internal flash memory into two separate blocks:

  • Block 1 (Bootloader + Application) begins at address 0x08000000

  • Block 2 (Bootloader + Application) begins at address 0x08020000

Each block contains its own independent bootloader and main application code.

Issue:

When executing firmware from Block 2 and a system reset occurs, the microcontroller restarts execution from Block 1 (i.e., address 0x08000000), instead of continuing from Block 2 (0x08020000).

My Questions:

  1. In this type of dual-block configuration, how should the vector table be set for each block to ensure correct interrupt handling and boot behavior?

  2. What specific modifications are required in the IAR .icf (linker) file for both Block 1 and Block 2 to support this configuration?

  3. How can I ensure that when Block 2 is actively running, a reset will result in restarting Block 2 instead of falling back to Block 1?

Any guidance or best practices for managing vector table relocation and startup logic in this scenario would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

When the chip resets, it will always start at 0x08000000. You'll have to implement logic in that program to jump to 0x08020000 under certain conditions. Set an address in RAM that doesn't get clobbered on startup and use that to determine whether or not to jump to the other application or stay in the current one.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Super User

When the chip resets, it will always start at 0x08000000. You'll have to implement logic in that program to jump to 0x08020000 under certain conditions. Set an address in RAM that doesn't get clobbered on startup and use that to determine whether or not to jump to the other application or stay in the current one.

If you feel a post has answered your question, please click "Accept as Solution".