2025-04-07 5:18 AM
STM32CubeProgrammer 2.18.0 and 2.19.0
STLINK-V3SET FW V3J16M7B5S1.
STM32H563RIT6 rev X. Bootloader version 0xE4.
1. Connect under reset.
2. Configure MCU with EDATA1_EN=1 EDATA1_STRT=0x7
3. Erase sectors 120–127 and fill them with byte 0xEC.
4. Create a file file.bin file with 10 bytes of some data.
5. STM32_Programmer_CLI.exe --connect port=SWD mode=UR speed=fast ap=1 -d file.bin 0x09001800
I expect sector 121 to be erased and the first 10 bytes of it programmed with contents of file.bin.
Actually, sectors 121–127 are erased and the first 10 bytes of sector 121 are programmed with contents of file.bin. I.e. it seems erase is done for the reminder of the bank instead of calculating the number of affected sectors from file length.
But if you set EDATA1_EN=0 and download file.bin to 0x08002000 it works. The system only misbehaves when the flash is configured as high-cycle count flash.
The problem can also be reproduced by using a .hex-file targeting these addresses.
Would it possible to fix this bug in the next version of STM32CubeProgrammer?
Best regards, Jesper