Commit d9b9e888 authored by robert-hh's avatar robert-hh Committed by Damien George

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 #14190.
Signed-off-by: default avatarrobert-hh <robert@hammelrath.com>
parent 3980b361
......@@ -337,9 +337,13 @@ static mp_obj_t samd_qspiflash_make_new(const mp_obj_type_t *type, size_t n_args
// The write in progress bit should be low.
while (read_status() & 0x01) {
}
// The suspended write/erase bit should be low.
while (read_status2() & 0x80) {
if (!flash_device->single_status_byte) {
// The suspended write/erase bit should be low.
while (read_status2() & 0x80) {
}
}
run_command(QSPI_CMD_ENABLE_RESET);
run_command(QSPI_CMD_RESET);
// Wait 30us for the reset
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment