cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to erase memory, but flashing possible with TouchGFX Designer and STM32CubeIDE.

HTD
Senior III

The devices I try to flash are H745 and H747 discovery boards, one is a partner vendor HMI, but supported by ST. They all use pretty complex QSPI memory layout, but flashing them using TouchGFX Designer and STM32CubeIDE works.

But STM32CubeProgramer, despite using exactly the same image files (hex or elf) - works RANDOMLY.

If the device is in the "right" state (whatever "right" means here) - it works. I can repeat the process over and over again and it always succeeds. However, anything goes wrong (like I aborted flashing once) - the device looks bricked. I can connect to it via SWD, but it doesn't download any files to it, I get "Failed to erase memory".

However, I use the flashing option from the TouchGFX Designer and it flashed the device without problems. Then flashing from Cube Programmer works too.

Another case: whenever I use STM32CubeIDE to debug my project, the Cube Programmer cannot be used, it shows the same error. My solution is to use STM32CubeIDE "Run" options (not "Debug"!), then Programmer works again. BTW, I double checked I use the correct external loader for my board.

What makes Cube Programmer fail at the start of the flashing process? Doesn't TouchGFX Designer use Cube Programmer to do the flashing via command line? What's the difference between those two?

Why tools other than Cube Programmer have no problem with downloading, and the Cube Programmer fails?

2 REPLIES 2

Issue with Internal or External memory?

Correct External Loader? Mode that memory is left in, doesn't have an Async Reset, needs to be sent commands.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Actually both. TBH, all my projects had external loaders that were used to flash both from one file. One project has a custom external loader that requires to upload external and internal memory separately. The script they provide in TouchGFX project uploads external first, then internal. It works, on the console I see it even invokes the Cube Programmer CLI. Now - I try (to save time) do that manually (having the hex files already made) download them with Programmer - works again. So I take another board and try to do the same, but this time I hit the wrong button, then in panic I cancel whatever was started. I try to repeat the process, but this time it doesn't work. Programmer refuse to write both external and internal parts. I tried to reconnect the device, restart the program, nothing works. Then I try to flash this board from TouchGFX designer, and it just completes successfully. I mean - the designer internally uses Cube Programmer to do actual flashing, so does it pass an extra option to it to make it work? If so, what's the trick?