summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dean <bsd@bdmicro.com>2020-05-03 18:33:01 -0400
committerBrian Dean <bsd@bdmicro.com>2020-05-03 18:33:01 -0400
commit28179a3aafa038c621f49a73cc243357629e0cff (patch)
treeb8e152403d8046a09bf4d24a5220d4605ca0f471
parent242063e1d0bb34e0eaa1c91ba8247c93c69ab1e7 (diff)
.../external_flash.c: Don't attempt to issue CMD_READ_STATUS2 for
devices with only a single_status_byte.
-rw-r--r--supervisor/shared/external_flash/external_flash.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c
index 69eeec43d..bfc434664 100644
--- a/supervisor/shared/external_flash/external_flash.c
+++ b/supervisor/shared/external_flash/external_flash.c
@@ -218,11 +218,12 @@ void supervisor_flash_init(void) {
do {
spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
} while ((read_status_response[0] & 0x1) != 0);
- // The suspended write/erase bit should be low.
- do {
+ if (!flash_device->single_status_byte) {
+ // The suspended write/erase bit should be low.
+ do {
spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1);
- } while ((read_status_response[0] & 0x80) != 0);
-
+ } while ((read_status_response[0] & 0x80) != 0);
+ }
spi_flash_command(CMD_ENABLE_RESET);
spi_flash_command(CMD_RESET);