Add SPIF_ULBPR command and replace wrong command to clear all write-protection bits in the Block-Protection register.

pull/9507/head
Philipp Steiner 2019-01-17 10:10:52 +01:00 committed by adbridge
parent 09c8b99ec9
commit 331c66d4fb
1 changed files with 2 additions and 1 deletions

View File

@ -88,6 +88,7 @@ enum spif_default_instructions {
SPIF_RSTEN = 0x66, // Reset Enable
SPIF_RST = 0x99, // Reset
SPIF_RDID = 0x9f, // Read Manufacturer and JDEC Device ID
SPIF_ULBPR = 0x98, // Clears all write-protection bits in the Block-Protection register
};
// Mutex is used for some SPI Driver commands that must be done sequentially with no other commands in between
@ -169,7 +170,7 @@ int SPIFBlockDevice::init()
// SST devices come preset with block protection
// enabled for some regions, issue write disable instruction to clear
_set_write_enable();
_spi_send_general_command(SPIF_WRDI, SPI_NO_ADDRESS_COMMAND, NULL, 0, NULL, 0);
_spi_send_general_command(SPIF_ULBPR, SPI_NO_ADDRESS_COMMAND, NULL, 0, NULL, 0);
break;
}