From d1daa4a205589f058faeef9ba93eae7b25ca4dd2 Mon Sep 17 00:00:00 2001 From: Ed Date: Thu, 18 Mar 2021 09:17:05 +0000 Subject: [PATCH] Skip verify after sector erase to prevent 5ms delay --- lib_dfu/src/dfu.xc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib_dfu/src/dfu.xc b/lib_dfu/src/dfu.xc index 66b383058..3bf92bfb2 100644 --- a/lib_dfu/src/dfu.xc +++ b/lib_dfu/src/dfu.xc @@ -200,8 +200,10 @@ static enum dfu_status getstatus_from_dnload(bool &busy) case DNLOAD_ERASING_SECTOR: if (!flash_is_busy()) { - if (!flash_is_sector_erased(dnload.next_page_address)) - return ERR_CHECK_ERASED; + // See https://github.com/xmos/lib_dfu/issues/44 + // This works around a problem seen where I2C clock stretching for 5ms breaks the DFU process + // if (!flash_is_sector_erased(dnload.next_page_address)) + // return ERR_CHECK_ERASED; if (!is_address_in_an_upgrade_slot(dnload.next_page_address)) return ERR_ADDRESS;