tests: Bluetooth: Mesh: Use flash_area_flatten for erase

The flash_area_erase is replaced with flash_area_flatten that
is also able to erase/scramble devices that do not require
explicit call to erase procedure before write.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2024-03-09 22:44:28 +00:00 committed by Henrik Brix Andersen
commit 8dc1fcec03

View file

@ -68,7 +68,7 @@ ZTEST(blob_io_flash, test_chunk_read)
err = flash_area_open(SLOT1_PARTITION_ID, &fa);
zassert_equal(err, 0, "Preparing test data failed with err=%d", err);
err = flash_area_erase(fa, 0, ARRAY_SIZE(ctrl_data));
err = flash_area_flatten(fa, 0, ARRAY_SIZE(ctrl_data));
zassert_equal(err, 0, "Preparing test data failed with err=%d", err);
err = flash_area_write(fa, 0, test_data, ARRAY_SIZE(ctrl_data));