From 5d4b43146cd6d17acb897535837143b63852745d Mon Sep 17 00:00:00 2001 From: Timothy Mertz Date: Tue, 30 Aug 2022 17:08:44 -0500 Subject: [PATCH] Wait for FlashDeflateEnd ack When using the stub, the data sent in FlashDeflateData is not actually written to flash until after the ack is sent by the stub. Waiting for FlashDeflateEnd ensures that all data sent during with FlashDeflateData has been fully written. --- espflash/src/flash_target/esp32.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/espflash/src/flash_target/esp32.rs b/espflash/src/flash_target/esp32.rs index 462d7b8f..d40202ef 100644 --- a/espflash/src/flash_target/esp32.rs +++ b/espflash/src/flash_target/esp32.rs @@ -159,7 +159,7 @@ impl FlashTarget for Esp32Target { fn finish(&mut self, connection: &mut Connection, reboot: bool) -> Result<(), Error> { connection.with_timeout(CommandType::FlashDeflateEnd.timeout(), |connection| { - connection.write_command(Command::FlashDeflateEnd { reboot: false }) + connection.command(Command::FlashDeflateEnd { reboot: false }) })?; if reboot { connection.reset()