From 939470df526f4dc50ee2c5f33405bc38fcf90184 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Mon, 11 Jan 2021 20:54:53 +0100 Subject: [PATCH] Wait before sending the firmware data Without the small delay, sending the first frame often fails. Trying to read the ACK response byte just fails with a timeout, and no data is received at all. The bootloader is probably not ready to receive data yet. --- src/divesystem_idive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/divesystem_idive.c b/src/divesystem_idive.c index 0659d06..b544ecb 100644 --- a/src/divesystem_idive.c +++ b/src/divesystem_idive.c @@ -903,6 +903,9 @@ divesystem_idive_device_fwupdate (dc_device_t *abstract, const char *filename) goto error_free; } + // Wait before sending the firmware data. + dc_iostream_sleep (device->iostream, 100); + // Upload the firmware. unsigned int offset = 0; while (offset + 2 <= size) {