Hi Andrew, I had the same issue with a STM32F103VG. This is also a XL-Density chip. You can find my findings and (similar) solution in https://sourceforge.net/p/stm32flash/tickets/140/ @tormod Seems both tickets address the same problem
With this script I created the hexfiles above. I used a simple blinky as base hexfile and attached 0xAA until the specified size.
With commit e27a8f this call is working: stm32flash -i 65,64,-65,65:65,-64,-65,65 -b 57600 -w test_314368_byes.hex /dev/ttymxc4 this is failing: stm32flash -i 65,64,-65,65:65,-64,-65,65 -b 57600 -w test_315392_byes.hex /dev/ttymxc4 With the patch above both are working.
With commit e27a8f this call is working: stm32flash -i 65,64,-65,65:65,-64,-65,65 -b 57600 -w test_314368_byes.hex /dev/ttymxc4 this is failing: stm32flash -i 65,64,-65,65:65,-64,-65,65 -b 57600 -w test_315392_byes.hex /dev/ttymxc4 With the patch above both are working.
I created a script to generate hexfiles with different sizes. I nailed it down to 154 pages.
Yes, the wait is between Erasing memory and Failed to read ACK byte. I also have to correct myself, the size of the hex-file equals 350 flash-pages. I compiled now commit e27a8f which results in this output: stm32flash -i 65,64,-65,65:65,-64,-65,65 -b 57600 -w test.hex -v -n 10 /dev/ttymxc4 stm32flash 0.6 http://stm32flash.sourceforge.net/ Using Parser : Intel HEX Location : 0x8000000 Size : 716652 Interface serial_posix: 57600 8E1 GPIO sequence start setting gpio 65 to 1... OK delay 100000 us setting...
stm32flash 0.6 not working with STM32F103VG