2024-02-25 07:49 AM
Hi dear experts,
I want to know is there a way to only program Bank2 and run the firmware from it? I manage to program Bank2 and set the BFB2=1 but i cant get the firmware to run. Am i making a mistake by not programming the Bank1 at all?
i should mention that i used a right linker file for Bank2 firmware and i have also take a look the AN4767 and AN2606. Do I need any additional code to be programmed to Bank1 even if I'm not using it at all?
Solved! Go to Solution.
2024-02-26 09:45 PM
I actually found the problem. In my case i didn't pay attention to SYSCFG_CFGR1_UFB register. I was trying to switch the bank purely with the BFB2 option byte and also built the firmware for the address of bank2 which is wrong. Actually didn't know that when i switch the bank, the second bank's address will be always be bound to virtual address 0x08000000. Thanks to all the experts who have participated in this topic.
2024-02-26 05:44 AM
Hello @mehdihfzp,
Thank you for your question !
Here are some questions / remarks :
Q1 : Am i making a mistake by not programming the Bank1 at all?
A1 : No, as mentionned in the RM0367, the STM32L0x3 have a dual boot capability depending on BFB2 bit status. It is important to keep BFB2 flag set when there is no code in Bank1, thus being safe in case of unexpected power failures.
Q2 : Do I need any additional code to be programmed to Bank1 even if I'm not using it at all?
A2 : No, if you are not using it at all but what is your application ?
Best Regards,
Pierre
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.
2024-02-26 09:45 PM
I actually found the problem. In my case i didn't pay attention to SYSCFG_CFGR1_UFB register. I was trying to switch the bank purely with the BFB2 option byte and also built the firmware for the address of bank2 which is wrong. Actually didn't know that when i switch the bank, the second bank's address will be always be bound to virtual address 0x08000000. Thanks to all the experts who have participated in this topic.