zephyr/subsys/storage/stream/Kconfig
Dominik Ermel bb0fa0746b stream_flash: Enforce size to be explicitly present on init
The commit changes requirements for stream_flash_init, where size
can no longer be 0 and has to be explicitly set, to avoid situation
where size autodetection, invoked by size == 0, would miss changes in
layout and silently allow overflow of Stream Flash into other partitions.

There has also been new Kconfig option CONFIG_STREAM_FLASH_INSPECT,
set to y by default to keep legacy behaviour, that can be used to turn
off stream_flash_ctx vs device inspection, allowing user to shed
inspection code once it is not useful anymore.

Fixes: #71042

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-07 15:56:49 +01:00

53 lines
1.5 KiB
Plaintext

#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
menuconfig STREAM_FLASH
bool "Stream to flash"
help
Enable support of stream to flash API
if STREAM_FLASH
config STREAM_FLASH_INSPECT
bool "Check whether device layout is OK with Stream Flash definition"
default y
select FLASH_PAGE_LAYOUT
help
Runs simple check to find whether provided device can be used for
stream flash by verifying that buffer size will fit into page.
Once correct configuration has been established and tested it is
worth to disable the option to cut out some unneeded code.
config STREAM_FLASH_POST_WRITE_CALLBACK
bool "Write complete callback"
default y
help
Enable callback that will be invoked once data is synchronized from
stream to device. When callback is not used, disabling the option
allows to save some code storage and RAM.
config STREAM_FLASH_ERASE
bool "Perform erase operations"
depends on FLASH_HAS_EXPLICIT_ERASE
help
If disabled an external actor must erase the flash area being written
to.
config STREAM_FLASH_PROGRESS
bool "Persistent stream write progress"
depends on SETTINGS
depends on !SETTINGS_NONE
help
Enable API for loading and storing the current write progress to flash
using the settings subsystem. In case of power failure or device
reset, the API can be used to resume writing from the latest state.
module = STREAM_FLASH
module-str = stream flash
source "subsys/logging/Kconfig.template.log_config"
endif # STREAM_FLASH