TX_length limit ignored by stm32_run_raw_code()
Open source flash program for STM32 using the ST serial bootloader
Brought to you by:
tormod
TX_length is not obeyed by stm32.c:stm32_run_raw_code().
The run_raw_code function always uses maximum 256 byte transfers ignoring any lower limit set by the "-F" command line parameter.
This causes reset command to fail when using MCP2221 USB-I2C bridge on Linux (hardware bug limiting transfers to ~64 bytes.
Anonymous
Thanks for the report. I have made a suggestion here: https://sourceforge.net/p/stm32flash/code/merge-requests/27/ Can you please try it out?
Due to the way the tx_size is handled you will need to do the same "-2 byte" adjustment in run_raw_code as in main.c:527 otherwise the write won't be 4 byte aligned.
With the following change the code works in my setup (with -F 34:34).
Right, thanks for correcting this. I have applied a fix mimicking the pattern in main.c.