I use Zephyr flash_erase() to erase Winbond W25Q32JV NOR flash. But I flash_erase() return error code -19. What is meaning of error code -19? And how to fix this issue?
The following is code to call flash_erase().
int flashNorEraseData(const off_t offset, const size_t len) {
if (!flashNorGetInitialzed()) {
return ERROR_NOR_UNINITIALIZED;
}
const int ret = flash_erase(_gFlashDev, offset, len);
if (ret < 0) {
printk("flash_erase(%s, %ld, %u) faild %d\n", _gFlashDev->name, offset, len, ret);
return ERROR_FSTORAGE_ERASE_FAIL;
}
return 0;
}
The following are log messages.
*** Booting Zephyr OS build v3.2.99-ncs2 *
jedec-id = [ef 40 16]
_gDensity=4194304
flash_erase(w25q32jv@0, 524288, 4096) faild -19
Erasing from 524288 to 528383 failed