soc: arm: st: set SWO reference frequency based on 'rcc'

Configure SWO reference frequency to be the same as
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC. This should make all ST boards ready to
be used with SWO, without configuring any other devicetree property.

Tested with NUCLEO-L476RG and NUCLEO-H563ZI.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
Marcin Niestroj 2023-08-03 21:21:52 +02:00 committed by Carles Cufí
commit f15e7c5909

View file

@ -16,6 +16,13 @@ DT_STM32_RCC_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_RCC_PATH),clock-fre
config SYS_CLOCK_HW_CYCLES_PER_SEC
default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)"
if LOG_BACKEND_SWO
config LOG_BACKEND_SWO_REF_FREQ_HZ
default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)"
endif # LOG_BACKEND_SWO
# set the tick per sec as a divider of the LPTIM clock source
config SYS_CLOCK_TICKS_PER_SEC
default 4096 if STM32_LPTIM_TIMER && STM32_LPTIM_CLOCK_LSE