Link copied to clipboard!

Solved: failed to erase memory on Riverdi STM32U5 displays

For 5″ STM32U5A9/G9 modules, we identified that STM32CubeProgrammer 2.23 causes the Flash erase step to fail, while version 2.22 completes it correctly. It occurs during a standard flashing process that previously worked without issues: the project is prepared correctly and communication with the module is established, but the erase step itself fails. If you’re seeing this error, it’s not a sign of a faulty module or a broken project.

We reproduced this locally on our 5″ U5 A9/G9 modules, using the official Board Specific Demo project for STM32U5G9 (PCB_50STM32U5G9_REV1.1), created in TouchGFX Designer 4.26.1, and confirmed that STM32CubeProgrammer 2.22 completes the erase step correctly.

Board-specific demo project

 

Although this issue occurs specifically in STM32CubeProgrammer, it is documented here through TouchGFX Designer, since Designer’s “Program and Run Target” feature calls STM32CubeProgrammer internally to build and flash the project. The TouchGFX Designer version is noted for full transparency of the tested environment – you’ll see it again in the console output below, even though Designer itself is not the cause of the issue.

STM32CubeProgrammer returns the following error:

“Error: failed to erase memory” 

Flash memory erase failure

 

If you’re working on STM32CubeProgrammer 2.23 and see this error, use version 2.22 until we confirm a newer validated version. After downgrading, the Flash memory erases correctly and the project can be written to the module.

The erase step fails before the new project can be written, so the flashing process is aborted and the module is left without a valid application.

Successful flash after downgrad

 

Version 2.22 is available on ST website (MyST account is required). Since 2.23 is the version offered by default, you’ll need to look for 2.22 specifically in the archived releases section.

STM32CubeProgrammer version archive on ST's website

 

Background 

This issue was first reported through customer tickets in our Tech Support system. We validated STM32CubeProgrammer 2.22 as a working version for these modules as part of our internal testing, and we’ll update this article once a newer validated version is confirmed.

 

DISCOVER OUR

Whitepaper

Achieve the perfect user-display interaction with the right Touch Sensor IC. Ever faced issues with phantom touch events or certification? Boost your R&D like a pro with our Whitepaper!

Save by quality

Go to our product catalog and see how you can save by quality, not on quality.

Contact us now, save with quality, not on quality.