Skip to content

Commit 676b56a

Browse files
de-nordicrghaddab
authored andcommitted
[nrf fromtree] samples/usb/imass: 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 provide erase callback. Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit 856d770)
1 parent 3f9e9e7 commit 676b56a

File tree

1 file changed

+1
-1
lines changed
  • samples/subsys/usb/mass/src

1 file changed

+1
-1
lines changed

samples/subsys/usb/mass/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static int setup_flash(struct fs_mount_t *mnt)
8989

9090
if (rc < 0 && IS_ENABLED(CONFIG_APP_WIPE_STORAGE)) {
9191
printk("Erasing flash area ... ");
92-
rc = flash_area_erase(pfa, 0, pfa->fa_size);
92+
rc = flash_area_flatten(pfa, 0, pfa->fa_size);
9393
printk("%d\n", rc);
9494
}
9595

0 commit comments

Comments
 (0)