I believe this is what you are referring to. Setting “CONFIG_APP_WIPE_STORAGE=y” in prj.cnf gives me compile error.
`static int littlefs_flash_erase(unsigned int id)
{
const struct flash_area *pfa;
int rc;
rc = flash_area_open(id, &pfa);
if (rc < 0)
{
LOG_ERR("FAIL: unable to find flash area %u: %d\n",
id, rc);
return rc;
}
LOG_PRINTK("Area %u at 0x%x on %s for %u bytes\n",
id, (unsigned int)pfa->fa_off, pfa->fa_dev->name,
(unsigned int)pfa->fa_size);
/* Optional wipe flash contents */
if (IS_ENABLED(CONFIG_APP_WIPE_STORAGE))
{
rc = **flash_area_erase**(pfa, 0, pfa->fa_size);
LOG_ERR("Erasing flash area ... %d", rc);
}
flash_area_close(pfa);
return rc;
}`
I tried that and receiving the following error
[00:00:39.221,893] <err> PWL: Erasing flash area ... 0
[00:00:39.228,332] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1374: Corrupted dir pair at {0x0, 0x1}
[00:00:39.239,135] <err> fs: failed get file or dir stat (-14)
[00:00:39.245,666] <err> PWL: statvfs: -14
[00:00:39.250,488] <inf> PWL: bsize = 16 ; frsize = 4096 ; blocks = 4096 ; bfree = 0