The FCB has been strongly tied to 0xff erased flash devices and this
commit adds support for other erase values.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Switch form using privater FCB error codes to
errno codes. FCB private codes convention were compatible
with <errno.h> codes:
- 0 mean success
- negative values mean errors
- similar error types.
There was no sense to kept private FCB error codes.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Increase temporary buffer size to 8 bytes in fcb_append to prevent
stack overflow in case flash alignment is bigger then 2 bytes.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
move fcb.h to fs/fcb.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This is bug-fix for issue #7311
FCB: CRC write size in append_finish doesn't honor
flash min write size
This patch changes write size to the minimum supported
write size.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Prior to this commit: `struct fcb` contained a pointer to an array of
`struct flash_area`. Each entry in the array represented a flash sector
that the fcb comprised.
After commit: `struct fcb` contains a pointer to an array of `struct
flash_sector`, not `struct flash_area`.
Rationale: The FCB needs to know which sectors it occupies for its
rotate operation. However, the `flash_area` type is meant to represent
a collection of sectors, not a single sector. `struct flash_area`
contains information that the fcb does not need (e.g., area ID and
device ID). Furthermore, the flash_map API provides a means of
converting a flash area ID to an array of sectors
(`flash_area_get_sectors()`), but no way to convert to an array of
areas.
Signed-off-by: Christopher Collins <ccollins@apache.org>
Zephyr already supports NFFS as a storage layer, but it might
be a little bit too heavyweight for certain applications in
memory-restricted ICs.
This module is response for need of Lightweight flash storage
capability. FCB is ported form MyNewt as native zephyr module.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>