Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 13 additions & 52 deletions soc/st/stm32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,29 @@ if SOC_FAMILY_STM32

rsource "*/Kconfig"

# STM32 wide symbols definitions

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CCM := zephyr,ccm

config STM32_CCM
def_bool $(dt_chosen_enabled,$(DT_CHOSEN_Z_CCM))

# `common/Kconfig` declares all Kconfig options used to
# configure the family-wide code found in `common/`.
Comment on lines +13 to +14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit unclear. what about:

Kconfig options used to configure the family-wide code 
found in `common/` are made available in common/Konfig

#
# However, some Kconfig options are shared by all series but
# not consumed by common code; instead, SoC-specific code,
# certain drivers or the STM32Cube HAL module will make use
# of them. Such Kconfig options are declared here.
Comment on lines +16 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# However, some Kconfig options are shared by all series but
# not consumed by common code; instead, SoC-specific code,
# certain drivers or the STM32Cube HAL module will make use
# of them. Such Kconfig options are declared here.
# Kconfig options shared by all series, but not consumed by common code,
# such as SoC-specific code, certain drivers or the STM32Cube HAL module
# are declared below.

#
# (Please indicate as a comment where each option is consumed)

# This option is consumed by the HAL module
config USE_STM32_ASSERT
depends on ASSERT
bool "STM32Cube HAL and LL drivers asserts"
help
Enable asserts in STM32Cube HAL and LL drivers.

config STM32_BACKUP_SRAM
bool "STM32 Backup SRAM"
default y
depends on DT_HAS_ST_STM32_BACKUP_SRAM_ENABLED
help
Enable support for STM32 backup SRAM.

config STM32_BACKUP_SRAM_INIT_PRIORITY
int "STM32 Backup SRAM init priority"
default APPLICATION_INIT_PRIORITY
depends on STM32_BACKUP_SRAM
help
STM32 Backup SRAM device initialization priority.

config STM32_ENABLE_DEBUG_SLEEP_STOP
bool "Allow debugger attach in stop/sleep Mode"
default y if DEBUG
help
Some STM32 parts disable the DBGMCU in sleep/stop modes because
of power consumption. As a side-effects this prevents
debuggers from attaching w/o resetting the target. This
effectively destroys the use-case of `west attach`. Also
SEGGER RTT and similar technologies need this.

config SWJ_ANALOG_PRIORITY
int "SWJ DP port to analog routine initialization priority"
default 49
help
Initialization priority of the routine within the PRE_KERNEL1 level.
This priority must be greater than GPIO_INIT_PRIORITY and lower than
UART_INIT_PRIORITY.

config HAS_STM32_FLASH_PREFETCH
bool
help
Hidden symbol selected by SoCs which support flash prefetch.

# This option is consumed by `soc.c` of applicable series
config STM32_FLASH_PREFETCH
bool "Flash prefetch buffer"
default y
Expand All @@ -70,18 +42,7 @@ config STM32_FLASH_PREFETCH
be enabled when flash is accessed through a cache memory. Flash
prefetch also improves performances a bit.

config STM32_WKUP_PINS
bool "STM32 PWR Wake-up Pins"
depends on DT_HAS_ST_STM32_PWR_ENABLED
help
Enable support for STM32 PWR wake-up pins.

config STM32_BACKUP_PROTECTION
bool "SoC has backup domain protection access"
help
Enabled for SoCs for which access protection to backup domain
resources needs to be explicitly handled.

# This option is consumed by external flash drivers
config STM32_APP_IN_EXT_FLASH
bool
help
Expand Down
55 changes: 55 additions & 0 deletions soc/st/stm32/common/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2025 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0
#
# Kconfig options for STM32 family-wide common code
Copy link
Member

@erwango erwango Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disambiguate 'common'

Suggested change
# Kconfig options for STM32 family-wide common code
# Kconfig options for STM32 family-wide common/ code

#

# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CCM := zephyr,ccm

config STM32_CCM
def_bool $(dt_chosen_enabled,$(DT_CHOSEN_Z_CCM))

config STM32_BACKUP_SRAM
bool "STM32 Backup SRAM"
default y
depends on DT_HAS_ST_STM32_BACKUP_SRAM_ENABLED
help
Enable support for STM32 backup SRAM.

config STM32_BACKUP_SRAM_INIT_PRIORITY
int "STM32 Backup SRAM init priority"
default APPLICATION_INIT_PRIORITY
depends on STM32_BACKUP_SRAM
help
STM32 Backup SRAM device initialization priority.

config STM32_ENABLE_DEBUG_SLEEP_STOP
bool "Allow debugger attach in stop/sleep Mode"
default y if DEBUG
help
Some STM32 parts disable the DBGMCU in sleep/stop modes because
of power consumption. As a side-effects this prevents
debuggers from attaching w/o resetting the target. This
effectively destroys the use-case of `west attach`. Also
SEGGER RTT and similar technologies need this.

config SWJ_ANALOG_PRIORITY
int "SWJ DP port to analog routine initialization priority"
default 49
help
Initialization priority of the routine within the PRE_KERNEL1 level.
This priority must be greater than GPIO_INIT_PRIORITY and lower than
UART_INIT_PRIORITY.

config STM32_WKUP_PINS
bool "STM32 PWR Wake-up Pins"
depends on DT_HAS_ST_STM32_PWR_ENABLED
help
Enable support for STM32 PWR wake-up pins.

config STM32_BACKUP_PROTECTION
bool "SoC has backup domain protection access"
help
Enabled for SoCs for which access protection to backup domain
resources needs to be explicitly handled.