Skip to content

Commit 28179a3

Browse files
committed
.../external_flash.c: Don't attempt to issue CMD_READ_STATUS2 for
devices with only a single_status_byte.
1 parent 242063e commit 28179a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

supervisor/shared/external_flash/external_flash.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ void supervisor_flash_init(void) {
218218
do {
219219
spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
220220
} while ((read_status_response[0] & 0x1) != 0);
221-
// The suspended write/erase bit should be low.
222-
do {
221+
if (!flash_device->single_status_byte) {
222+
// The suspended write/erase bit should be low.
223+
do {
223224
spi_flash_read_command(CMD_READ_STATUS2, read_status_response, 1);
224-
} while ((read_status_response[0] & 0x80) != 0);
225-
225+
} while ((read_status_response[0] & 0x80) != 0);
226+
}
226227

227228
spi_flash_command(CMD_ENABLE_RESET);
228229
spi_flash_command(CMD_RESET);

0 commit comments

Comments
 (0)