From 64ccfb0479cade35e754c8dbe92b8cac169059df Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Fri, 1 Mar 2024 19:28:31 +0000 Subject: [PATCH] fs/fcb: Replace flash_area_erase with flash_area_flatten FCB depends on explicit erase characteristics of a device. Signed-off-by: Dominik Ermel --- subsys/fs/fcb/fcb.c | 3 +-- tests/subsys/fs/fcb/testcase.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/subsys/fs/fcb/fcb.c b/subsys/fs/fcb/fcb.c index 778df0f54a6..44358a8dbea 100644 --- a/subsys/fs/fcb/fcb.c +++ b/subsys/fs/fcb/fcb.c @@ -82,8 +82,7 @@ fcb_erase_sector(const struct fcb *fcb, const struct flash_sector *sector) return -EIO; } - rc = flash_area_erase(fcb->fap, sector->fs_off, sector->fs_size); - + rc = flash_area_flatten(fcb->fap, sector->fs_off, sector->fs_size); if (rc != 0) { return -EIO; } diff --git a/tests/subsys/fs/fcb/testcase.yaml b/tests/subsys/fs/fcb/testcase.yaml index e01566b6721..19e47e33a1b 100644 --- a/tests/subsys/fs/fcb/testcase.yaml +++ b/tests/subsys/fs/fcb/testcase.yaml @@ -12,6 +12,12 @@ tests: tags: flash_circural_buffer integration_platforms: - nrf52840dk/nrf52840 + filesystem.fcb.no_erase: + platform_allow: + - nrf54l15pdk/nrf54l15/cpuapp + filesystem.fcb.native_sim.no_erase: + extra_args: CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=n + platform_allow: native_sim filesystem.fcb.native_sim.fcb_0x00: extra_args: DTC_OVERLAY_FILE=boards/native_sim_ev_0x00.overlay platform_allow: native_sim