diff --git a/rtl837x_flash.c b/rtl837x_flash.c index 5f04c88a..2ec5bc3f 100644 --- a/rtl837x_flash.c +++ b/rtl837x_flash.c @@ -221,7 +221,9 @@ void flash_read_jedecid(void) */ void flash_read_bulk(__xdata uint8_t *dst) { - short status; + if (!flash_region.len) + return; + flash_configure_sio(); while (flash_read_status() & STATUS_REG_BUSY_MASK); flash_configure_mmio(); @@ -258,6 +260,9 @@ void flash_read_bulk(__xdata uint8_t *dst) void flash_read_security(void) { + if (!flash_region.len) + return; + flash_configure_sio(); while (flash_read_status() & STATUS_REG_BUSY_MASK);