zephyr/drivers/flash/Kconfig.stm32
Vincent Tardy 30d123cc90 drivers: flash : stm32wbax : Add flash manager thread
A flash manager thread is created and allocated to
process Flash Manager Process.
Definition of KConfigs STM32WBA_FLASH_MNGR_THREAD_STACK_SIZE,
and STM32WBA_FLASH_MNGR_THREAD_PRIO to configure the
flash manager thread.
STM32WBA_FLASH_MNGR_THREAD_STACK_SIZE is setting by default
to 768 bytes. This value was chosen empirically since reasonable
to cover generic cases.

Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
2026-05-28 11:06:47 +01:00

137 lines
4.6 KiB
Text

# ST Microelectronics STM32 MCUs Flash driver config
# Copyright (c) 2016 RnDity Sp. z o.o.
# Copyright (c) 2017 BayLibre, SAS
# Copyright (c) 2022 Linaro Limited
# Copyright (c) 2023 Google Inc
# SPDX-License-Identifier: Apache-2.0
config STM32_MEMMAP
bool "NOR Flash in MemoryMapped"
depends on DT_HAS_ST_STM32_QSPI_NOR_ENABLED || \
DT_HAS_ST_STM32_OSPI_NOR_ENABLED || \
DT_HAS_ST_STM32_XSPI_NOR_ENABLED
help
This option enables the MemoryMapped mode for the external NOR flash
mounted on STM32 boards.
menuconfig SOC_FLASH_STM32
bool "STM32 flash driver"
depends on DT_HAS_ST_STM32_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_DRIVER_ENABLED
default y
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_EXPLICIT_ERASE
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
select USE_STM32_HAL_FLASH if BT_STM32WBA
select USE_STM32_HAL_FLASH_EX if BT_STM32WBA
help
Enable flash driver for STM32 series
if SOC_FLASH_STM32
config FLASH_STM32_WRITE_PROTECT
bool "Extended operation for flash write protection control"
depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32H7X
select FLASH_HAS_EX_OP
default n
help
Enables flash extended operation for enabling/disabling flash write
protection.
config FLASH_STM32_WRITE_PROTECT_DISABLE_PREVENTION
bool "Prevent from disabling flash write protection"
depends on FLASH_STM32_WRITE_PROTECT
default n
help
If enabled, all requests to disable flash write protection will be
blocked.
config FLASH_STM32_READOUT_PROTECTION
bool "Extended operation for flash readout protection control"
depends on SOC_SERIES_STM32F4X || \
SOC_SERIES_STM32F7X || \
SOC_SERIES_STM32G0X || \
SOC_SERIES_STM32G4X || \
SOC_SERIES_STM32H7X || \
SOC_SERIES_STM32L4X || \
SOC_SERIES_STM32L5X || \
SOC_SERIES_STM32U5X
select FLASH_HAS_EX_OP
default n
help
Enables flash extended operation for enabling/disabling flash readout
protection.
config FLASH_STM32_READOUT_PROTECTION_DISABLE_ALLOW
bool "Allow disabling readout protection"
depends on FLASH_STM32_READOUT_PROTECTION
default n
help
With this option enabled it will be possible to disable readout
protection. On STM32 devices it will trigger flash mass erase!
config FLASH_STM32_READOUT_PROTECTION_PERMANENT_ALLOW
bool "Allow enabling readout protection permanently"
depends on FLASH_STM32_READOUT_PROTECTION
default n
help
With this option enabled it will be possible to enable readout
protection permanently.
config FLASH_STM32_BLOCK_REGISTERS
bool "Extended operation for blocking option and control registers"
select FLASH_HAS_EX_OP
default n
help
Enables flash extended operations that can be used to disable access
to option and control registers until reset. Disabling access to these
registers improves system security, because flash content (or
protection settings) can't be changed even when exploit was found.
config FLASH_STM32_OPTION_BYTES
bool "Extended operation for option bytes access"
select FLASH_HAS_EX_OP
default n
help
Enables flash extended operations that can be used to read and write
STM32 option bytes.
config USE_MICROCHIP_QSPI_FLASH_WITH_STM32
bool "Include patch for Microchip qspi flash when running with stm32"
depends on FLASH_STM32_QSPI || FLASH_STM32_OSPI || FLASH_STM32_XSPI
help
Set to use Microchip QSPI flash memories which use the PP_1_1_4 opcode
(32H) for the PP_1_4_4 operation (usually 38H).
config FLASH_STM32_ACCEPT_UNALIGNED_WRITES
bool "Extended operation for STM32 SoCs to handle unaligned offsets and lengths."
depends on SOC_STM32WBA65XX
help
Enable support for flash_write() calls when unaligned offsets and lengths are passed.
DO NOT ENABLE THIS OPTION WITHOUT UNDERSTANDING THE TARGET'S FLASH HARDWARE IMPLEMENTATION
DETAILS AND LIMITATIONS.
When this option is enabled, unaligned writes will be handled by writing to all blocks in range
[offset; offset + length]. Blocks for which only part of the contents are provided are padded with
the flash's erase value before writing. THIS IS NOT A READ-MODIFY-WRITE type operation! The flash
addresses being written to are expected to be erased before writing to them. Contens of the flash
after unaligned writes depend on the flash hardware details. The operation may fault.
if SOC_SERIES_STM32WBAX
config STM32WBA_FLASH_MNGR_THREAD_STACK_SIZE
int "Stack size of the Flash Manager thread for STM32WBAx"
default 768
help
Flash Manager thread stack size in bytes.
config STM32WBA_FLASH_MNGR_THREAD_PRIO
int "Flash Manager thread priority"
default 14
help
This option sets the cooperative priority of the Flash Manager thread.
endif # SOC_SERIES_STM32WBAX
endif # SOC_FLASH_STM32