spiFlash: ST M25P16

This commit is contained in:
Gwenhael Goavec-Merou 2023-03-04 18:14:37 +01:00
parent cda14f24e3
commit a5489e62f8
1 changed files with 8 additions and 0 deletions

View File

@ -399,6 +399,14 @@ int SPIFlash::erase_and_prog(int base_addr, uint8_t *data, int len)
_unprotect = true;
must_relock = true;
}
/* ST M25P16 has not TB bit:
* block protection is always in top mode:
* if write is not at offset 0 -> force unlock
*/
if ((_jedec_id >> 8) == 0x202015 && tb == 1 && base_addr != 0) {
_unprotect = true;
must_relock = true;
}
}
} else { // unknown chip: basic test
printWarn("flash chip unknown: use basic protection detection");