cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R5 Flash programming and dual bank switch

Ajoha.2
Associate

Hello community,

I'm currently having issues or perhaps not fully understanding the procedure of writing data to the MCU bank 2 and then switching to this bank to run the program from bank 2.

My setup for now is using a custom protocol for sending the generated .bin file through uart. I am currently just sending the .bin file in chunks to the first addr of bank 2(0x08080000) and incrementing it for every 8 byte write.

I do erase the bank 2 before writing to it. Here my understanding is that the number of pages is 127 and i start on page 0.

Once the write is done my unnderstanding is I should enable the BFB2 bit inorder for the MCU to boot from BANK2 once the system resets?

I have not been able to switch successfully, because I still get returned bank 1 being used when BFB2 bit is set.

1 REPLY 1
VTaya.1
Associate III

Use GO command to tell the application code start address.

If you could share your UART communication code block , It would be helpful to me.