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: robert-hh <robert@hammelrath.com>
pull/14133/head
robert-hh 2024-03-27 10:53:29 +01:00 zatwierdzone przez Damien George
rodzic 3980b36173
commit d9b9e88899
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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