Skip to content

Commit

Permalink
Fix hangs reading flash on Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Dec 27, 2023
1 parent 587e1ac commit 227ea77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flasher_stub/stub_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ void stub_tx_one_char(char c)
#if WITH_USB_JTAG_SERIAL
static int transferred_without_flush = 0;
if (stub_uses_usb_jtag_serial()){
// Defer flushing until we have a full packet or a 0xc0 byte to increase throughput.
// Defer flushing until we have a (full - 1) packet or a 0xc0 byte to increase throughput.
// Note that deferring flushing until we have a full packet causes hang-ups on some platforms.
transferred_without_flush++;
if( c == '\xc0' || transferred_without_flush == 64 ) {
if( c == '\xc0' || transferred_without_flush == 63 ) {
stub_tx_flush();
transferred_without_flush = 0;
}
Expand Down

0 comments on commit 227ea77

Please sign in to comment.