- Remove redundant cmake script as already added the CMake configuration file
- Remove redundant empty_baseline as it is no longer needed with the help of CMake configuration file
The documentation previously referred to a weakly defined function
`storage_configuration`, however, this function was replaced at some
stage by `kv_init_storage_config`. Refactor the explanation on how to
override the default configurations to reflect this. Also, remove
the snippet which was used to show the implentation of
`storage_configuration`.
NO_RBP (no rollback protection) is intended to not require an internal
TDB, however, DeviceKey, which we use to derive SecureStore's
encryption key, still does. Currently, no internal TDB is created with
these two configurations, meaning there's no way to store the DeviceKey
and SecureStore doesn't work.
- LittleFileSystem.h and LittleFileSystem.cpp refers to the littflefs headers with the complete path like storage/filesystem/littlefs/littlefs/lfs_util.h and fixed the path issue
- ChainingBlockModuleTest test case compares two strings with EXPECT_EQ
which normally compare strings residing memory address so replaced it with EXPECT_STREQ to compare strings.
Each block of HeapBlockDevice is only allocated from the heap when
that block is programmed. And erasing a block frees the associated
buffer.
To decide if there is enough heap to run the TDBStore Whitebox tests,
we need to perform a trial program() instead of erase().
From the documentations of `BlockDevice::get_erase_value()`:
-1 if you can't rely on the value of the erased storage
and `BlockDevice::program()`:
The blocks must have been erased prior to being programmed
So, `BlockDevice::erase()` should always be called regardless of
erase value.
Currently `TDBStore::offset_in_erase_unit()` and
`TDBStore::check_erase_before_write()` loop through erase units
one-by-one, until the entire range is covered. This is very inefficient
when the erase size is tiny, e.g. one-byte on a non-flash device for
which we use program as erase.
This commit reworks the algorithms, based on the fact that a block
device can erase or program as many units as needed in one go.
The "erased_set_get" test case deinits `FileSystemStore`, erases the
block device, and reinits `FileSystemStore`. This of course fails,
because `BlockDevice::erase()` removes all stored data including the
format of the `FileSystem` (middle layer), unless the particular type
of block device has a no-op erase implementation.
Note: Previously `HeapBlockDevice::erase()` was essentially a no-op
so this test case did not fail. We recently added the freeing of heap
memory and it uncovered the problem.
Mbed OS does not enable C++ exceptions, so we should call `new` with
`std::nothrow` which returns a C-style NULL pointer when allocation
fails to allow error handling.
For consistency of style within the same file, this commit also
replaces `malloc()` and `free()` to `new (std::nothrow)` and `delete`.
f_mount() is doing both initializing (via find_volume() -> disk_initialize() where disk_initialize api calls Mbed OS init() function)
underlying block device and register filesystem but in case of "unmount" calls this f_mount is doing deregister filesystem
and missed to a deinitializing block device. So added the Mbed OS "deint()" call in unmount API to deinitialize block device
as f_mount API doesn't have a way to call deinit().
Targets that inherit from this target will have the defines necessary to
place the WiFi firmware in external storage and enable use of the
external WiFi firmware reserved region block device.
Currently, the only target inheriting from this new target is
CY8CPROTO-062S3-4343W.