Failed to erase memory, but flashing possible with TouchGFX Designer and STM32CubeIDE.
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?
