summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2024-03-27 10:53:29 +0100
committerDamien George <damien@micropython.org>2024-03-28 15:52:40 +1100
commitd9b9e88899df86fec5679138f5f60ed62df0975f (patch)
treee6c75feca1718f040635e54475d391acb3b0adda
parent3980b361730a4d3313f6456fca1697db96b73870 (diff)
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>
-rw-r--r--ports/samd/samd_qspiflash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ports/samd/samd_qspiflash.c b/ports/samd/samd_qspiflash.c
index 60aa434dc..d027a0495 100644
--- a/ports/samd/samd_qspiflash.c
+++ b/ports/samd/samd_qspiflash.c
@@ -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