programming flash bank 2 sometimes fails with cli
I am using STM32CubeProgrammer (2.14.0) on Linux/Ubuntu 22.04 with NUCLEO-H563ZI.
I do not observe any problem when I use the GUI application but I would like to use the CLI.
I do not observe any issue when I write/download a program (elf or bin) to bank 1 (no bank swap) at 0x08000000 (or 0x0C000000). When I write to 0x08100000, I usually experience a problem, like this:
Opening and parsing file: firmware.elf
File : firmware.elf
Size : 4.28 KB
Address : 0x08100000
Erasing memory corresponding to segment 0:
Erasing internal memory sector 128
Download in Progress:
Error: failed to download Segment[0]
Error: failed to download the File
I realized if a mass erase (-e all) first, then the problem does not happen, and not happen in subsequent tries. But if I write to bank 1 once, then it fails again. Is there something special writing to bank 1 vs. bank 2 ? What could be the reason ? The device has trust zone enabled but product state is open.
