2023-04-07 02:00 AM - edited 2023-11-20 08:45 AM
Hi !
I'm using STM32CubeProgrammer v2.12.0 (according to the updater it is the latest at this time) and I want to enable Dualbank on my Nucleo board.
The Nucleo board is a NUCLEO-L476RG and is correctly recognized as such:
However in the Option bytes -> User Configuration tab, the DUALBANK option is missing:
The BFB2 option is present though, but as I understand it:
Am I right ?
In any case, shouldn't DUALBANK be shown since it is user configurable ?
Thanks in advance !
Solved! Go to Solution.
2023-04-07 03:33 AM
Hello @SDpy.1,
According to the reference manual, section 3.4 FLASH option bytes, DUALBANK Option Byte is present on 512 KB or 256 KB Flash memory devices. However, STM32L476RG MCU is 1MB Flash.
BFB2 controls dual bank boot not bank selection. Please refer to the reference manual or this post for further explanation.
Hope this helps!
Firas
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.
2023-04-07 03:33 AM
Hello @SDpy.1,
According to the reference manual, section 3.4 FLASH option bytes, DUALBANK Option Byte is present on 512 KB or 256 KB Flash memory devices. However, STM32L476RG MCU is 1MB Flash.
BFB2 controls dual bank boot not bank selection. Please refer to the reference manual or this post for further explanation.
Hope this helps!
Firas
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.
2023-04-17 02:03 AM
Hi !
Thanks for your reply, I just read the posts and also the RM you mentioned. Things are still not very clear, and based on the different posts on this subject, I think I am not alone in this case.
So there seems to be 3 different bits of configuration:
My assumptions are:
DUALBANK is always implicitly enabled for >512kB flash memory devices, so that's why there is no need for a DUALBANK option byte on those devices. On smaller flash size devices, we need to explicitly enable it by setting this option byte.
You say that BFB2 controls dual bank boot, not boot bank, so what's the difference with DUALBANK for <= 512kB devices ? Does it replace DUALBANK for >512kB devices ?
In my software, if I just want to swap banks, i.e reboot into the other bank without caring about which bank I'm currently in, which register to need to manipulate. DUALBANK (on <= 512kB devices) ? BFB2 ? FB_MODE ?
2023-04-17 04:43 AM
Hello @SDpy.1,
Thank you for your feedback.
Let me clarify some points:
BFB2 flag essentially triggers the attempt to boot from Bank2 on reset. See AN4767 section 3.1.3 BFB2 flag in user option bytes.
It is important to keep BFB2 flag set when there is no code in Bank1, thus being safe in case of unexpected power failures.
With BFB2 set, the system bootloader is activated to evaluate if a code is present in Bank2 and then puts it in control, as explained in AN2606. Then, the firmware has to detect that the code in Bank1 must be replaced, and that the process is running from Bank2.
Hope this answers your questions!
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.
2023-04-17 06:08 AM
Thanks for your clarification !