Skip to main content
Associate
Nov 14, 2024 14:25 UTC
Question

STM32U575 Bank1 Flashing Problem from Bank2

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.

10 replies

NFern.1
Associate III
Jun 27, 2025 03:30 UTC

I am facing the same issue. Please share the fix if you have managed to solve this.

Associate
Jun 29, 2025 03:21 UTC
Unfortunately I was unable to solve this problem
Associate
Dec 25, 2025 09:01 UTC

I am facing the same issue too. Please share the fix if you have managed to solve this.

NFern.1
Associate III
Dec 26, 2025 02:58 UTC

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

Associate
Dec 26, 2025 03:24 UTC

有一个点你是否注意到,就是flash擦除时,bank和page这两个参数,这里的bank是指物理bank,与是否从bank2启动无关。

Visitor II
Jun 24, 2026 05:56 UTC

Thanks ​@rulin , it works!