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). while (length > 0) { w = length > ( stm->tx_frame_max - 2) ? ( stm->tx_frame_max - 2 ) : length; if (stm32_write_memory(stm, address, pos, w) != STM32_ERR_OK) { free(mem); return STM32_ERR_UNKNOWN; }
TX_length limit ignored by stm32_run_raw_code()