Skip to main content
Jeroen deBuffel
Associate III
July 30, 2022
Question

STM32L082 - Dual NVM banks (how to boot from bank2)

  • July 30, 2022
  • 3 replies
  • 1711 views

Dear ST experts,

I am using the STM32L082 and looking to utilize the Dual Banks to be able to upgrade the firmware (swap between bank1 and bank2 and visa versa).

Have compiled code for BANK1 and compiled for BANK2. Code flashed to BANK1 (0x0800 0000) and BANK2 (0x0801 8000). With BFB2 bit set and reset I cannot see any activity (when running from BANK1 I see serial output).

Am I missing anything?

Thanks in advance

This topic has been closed for replies.

3 replies

Bubbles
ST Employee
August 5, 2022

hi @Jeroen deBuffel​ ,

the dual bank swapping works with remapping the memory. So in fact you should have code built for bank1 in BOTH banks. when the banks swap, bank2 is remapped to bank1 address range and the code will execute. See here for actual application:

https://www.st.com/resource/en/application_note/dm00230416-onthefly-firmware-update-for-dual-bank-stm32-microcontrollers-stmicroelectronics.pdf

BR,

J

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.
Jeroen deBuffel
Associate III
August 8, 2022

Hi J,

Thanks a lot for your feedback. I did read the AN your referred to earlier but I misunderstood.

Now when I understand correctly this time -> the following should work for the stm32L082:

  • Exact same code for bank1 can be written in bank2.
  • Flash bank1 and bank2 at the addresses as mentioned earlier.
  • Set BFB2 flag (1)
  • Reset the processor
  • Bank2 code will be running

KRs,

deBuffel

Bubbles
ST Employee
August 8, 2022

Hi @Jeroen deBuffel​ ,

you are welcome. I'm the author of that AN, so if you have some suggestion how to make it clearer, I'd be very pleased. If you misunderstood while reading it, surely there is a room for improvement in the AN text.

BR,

J

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.
Jeroen deBuffel
Associate III
August 9, 2022

Hi @JHOUD​ ,

Would be more than happy to provide you my feedback wrt the AN. I suggest I do it once I have the dual bank solution working (will send you the comments in a DM).

Btw - the steps I described above are correct?

KRs,

deBuffel

Jeroen deBuffel
Associate III
August 19, 2022

Thanks - will try to get it working in the coming weeks