2024-11-14 6:25 AM
I am trying to do OTA programming modifications using the DUAL bank feature of my STM32U575 IC with 1Mbyte of memory.
I have successfully done this when the program starts in BANK 1 and I reflash BANK 2. I change the User Option byte to OB_SWAP_BANK_ENABLE and the board reboots and successfully runs from BANK 2.
Now, on the next firmware update, programming BANK 1 when I am operating from BANK 2 the HAL_FLASH_Program command fails on the first byte.
The erase code is attached and it is very similar to others I have found on GIT for other products. Does the U5 have an inherent defect?
any help would be greatly appreciated.
2025-06-26 8:30 PM
I am facing the same issue. Please share the fix if you have managed to solve this.
2025-06-28 8:21 PM
2025-12-25 1:01 AM
I am facing the same issue too. Please share the fix if you have managed to solve this.
2025-12-25 6:58 PM - edited 2025-12-25 6:59 PM
I could not solve it. My other post on the same issue is unanswered by ST.
can't erase correct Flash Bank when attempting to ... - STMicroelectronics Community
2025-12-25 7:24 PM
有一个点你是否注意到,就是flash擦除时,bank和page这两个参数,这里的bank是指物理bank,与是否从bank2启动无关。
2025-12-25 7:40 PM
I google translated @rulin : One point you might have noticed is that during flash erase, the "bank" and "page" parameters refer to the physical bank, regardless of whether the program starts from bank2.
2025-12-25 7:52 PM
I encountered the same issue and just resolved it. The reason was that when erasing the flash, the specified bank should be the physical bank. For example, if the program starts from physical bank2 and wants to erase physical bank1, the bank in the erase operation should be specified as bank1. I previously thought that when starting from bank2, the physical bank1 should be the logical bank2, so I specified bank2 during the erase operation, which caused the previous issue.
2025-12-25 8:57 PM - edited 2025-12-25 9:10 PM
Please share the function / data-structure you use to determine the Active Flash Bank with the currently executing code. Also please share the function call with arguments for the Erase function.
2025-12-25 10:21 PM