Skip to content

Commit 3f9e9e7

Browse files
de-nordicrghaddab
authored andcommitted
[nrf fromtree] samples/fs/littlefs: Use flash_area_flatten to wipe storage
The commit replaces flash_area_erase with flash_area_flatten, as it allows to emulate erase and scramble data stored on devices that do not require explicit erase before write or do not provide erase callback. Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit e31b8c8)
1 parent 0a37bc7 commit 3f9e9e7

File tree

1 file changed

+1
-1
lines changed
  • samples/subsys/fs/littlefs/src

1 file changed

+1
-1
lines changed

samples/subsys/fs/littlefs/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int littlefs_flash_erase(unsigned int id)
252252

253253
/* Optional wipe flash contents */
254254
if (IS_ENABLED(CONFIG_APP_WIPE_STORAGE)) {
255-
rc = flash_area_erase(pfa, 0, pfa->fa_size);
255+
rc = flash_area_flatten(pfa, 0, pfa->fa_size);
256256
LOG_ERR("Erasing flash area ... %d", rc);
257257
}
258258

0 commit comments

Comments
 (0)