cancel
Showing results for 
Search instead for 
Did you mean: 

User bootloader, bootloader

pvall.1
Associate II

Hi all, I'm working on user bootloader in stm32l4p5 board. I'm facing problem in dual bank swapping. My plan is to keep bootloader code in bank 2 and application code in bank1. When ever a new bin file is available I will switch to bank2 ,after erasing bank1 and programming it, I will switch back to bank1. 

In the above process I followed the required steps for bank swapping that is changing vector offset  to 0x00080000 for bank2 and 0x00000000 and also managed to keep flash adress as 0x08000000 for bank1 and 0x08080000 for bank 2.

Bank 1 to bank2 switching is done properly but bank2 to 1 is not happening. It's going to either HARDFAULT Or jumping to 0x1FFFF000 address. 

Is there any additional steps required to switch from bank2 to bank 1? Suggest if any ideas 

Can any one provide sample code to test swapping between bank1 and 2 vice versa. 

 

 

3 REPLIES 3
FBL
ST Employee

Hello @pvall.1 

Here is an example project to swap flash banks STM32Cube\Repository\STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Examples\FLASH\FLASH_DualBoot

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi, it seems like above link is not opening. Can u re check it and provide it in the form of a link instead of words. 

Thanks

Hi, the link is extracted from the cube repository.  

STM32CubeL4/Projects/NUCLEO-L476RG/Examples/FLASH/FLASH_DualBoot at master · STMicroelectronics/STM32CubeL4 · GitHub

Normally, the process to jump from bank 2 to bank1 is identical.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.