@@ -1062,6 +1062,11 @@ int QSPIFBlockDevice::_handle_vendor_quirks()
1062
1062
_read_status_reg_2_inst = QSPIF_INST_RDCR;
1063
1063
_attempt_4_byte_addressing = false ;
1064
1064
break ;
1065
+ case 0x9d :
1066
+ // ISSI devices have only one status register
1067
+ tr_debug (" Applying quirks for ISSI" );
1068
+ _num_status_registers = 1 ;
1069
+ break ;
1065
1070
}
1066
1071
1067
1072
return 0 ;
@@ -1420,17 +1425,19 @@ qspi_status_t QSPIFBlockDevice::_qspi_read_status_registers(uint8_t *reg_buffer)
1420
1425
1421
1426
// Read Status Register 2 (and beyond, if applicable)
1422
1427
unsigned int read_length = _num_status_registers - 1 ; // We already read status reg 1 above
1423
- status = _qspi_send_general_command (_read_status_reg_2_inst, QSPI_NO_ADDRESS_COMMAND,
1424
- NULL , 0 ,
1425
- (char *) ®_buffer[1 ], read_length);
1426
- if (QSPI_STATUS_OK == status) {
1427
- tr_debug (" Reading Status Register 2 Success: value = 0x%x" , (int ) reg_buffer[1 ]);
1428
- if (_num_status_registers > 2 ) {
1429
- tr_debug (" Reading Register 3 Success: value = 0x%x" , (int ) reg_buffer[2 ]);
1428
+ if (read_length > 0 ) {
1429
+ status = _qspi_send_general_command (_read_status_reg_2_inst, QSPI_NO_ADDRESS_COMMAND,
1430
+ NULL , 0 ,
1431
+ (char *) ®_buffer[1 ], read_length);
1432
+ if (QSPI_STATUS_OK == status) {
1433
+ tr_debug (" Reading Status Register 2 Success: value = 0x%x" , (int ) reg_buffer[1 ]);
1434
+ if (_num_status_registers > 2 ) {
1435
+ tr_debug (" Reading Register 3 Success: value = 0x%x" , (int ) reg_buffer[2 ]);
1436
+ }
1437
+ } else {
1438
+ tr_error (" Reading Status Register 2 failed" );
1439
+ return status;
1430
1440
}
1431
- } else {
1432
- tr_error (" Reading Status Register 2 failed" );
1433
- return status;
1434
1441
}
1435
1442
1436
1443
return QSPI_STATUS_OK;
0 commit comments