From 9cfc7c5bd1b57ffb0ab8506107d453e778797f02 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 2 Jul 2020 21:27:05 -0500 Subject: [PATCH] wait for feedback more often during flashing There have been some reports of firmware flashing not working with a checksum timeout error, meaning that we probably overflowed a buffer on the Bluetooth chip from sending data too fast. We don't have info of the Bluetooth firmware so we are just guessing here. --- src/sagas/flash-firmware.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sagas/flash-firmware.ts b/src/sagas/flash-firmware.ts index 388182ab..114056b2 100644 --- a/src/sagas/flash-firmware.ts +++ b/src/sagas/flash-firmware.ts @@ -319,9 +319,11 @@ function* flashFirmware(action: FlashFirmwareFlashAction): Generator { yield put(progress(offset, firmware.length)); if (connectResult.canWriteWithoutResponse) { - // request checksum every 25 packets to prevent buffer overrun on - // the hub because of sending too much data at once - if (++count % 25 === 0) { + // Request checksum every 10 packets to prevent buffer overrun on + // the hub because of sending too much data at once. The actual + // number of packets that can be queued in the Bluetooth chip on + // the hub is not known and could vary by device. + if (++count % 10 === 0) { const checksumAction = (yield put( checksumRequest(), )) as BootloaderChecksumRequestAction;