Skip to content

Commit d9b9e88

Browse files
robert-hhdpgeorge
authored andcommitted
samd/samd_qspiflash: Avoid reading status byte 2 when not available.
Change provided by @ironss-iotec. Tested with Adafruit, SEEED and MiniFig boards for non-interference. Fixes issue micropython#14190. Signed-off-by: robert-hh <[email protected]>
1 parent 3980b36 commit d9b9e88

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ports/samd/samd_qspiflash.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,13 @@ static mp_obj_t samd_qspiflash_make_new(const mp_obj_type_t *type, size_t n_args
337337
// The write in progress bit should be low.
338338
while (read_status() & 0x01) {
339339
}
340-
// The suspended write/erase bit should be low.
341-
while (read_status2() & 0x80) {
340+
341+
if (!flash_device->single_status_byte) {
342+
// The suspended write/erase bit should be low.
343+
while (read_status2() & 0x80) {
344+
}
342345
}
346+
343347
run_command(QSPI_CMD_ENABLE_RESET);
344348
run_command(QSPI_CMD_RESET);
345349
// Wait 30us for the reset

0 commit comments

Comments
 (0)