From e8b898f450f46a8e66e3ea46f3ed1500c536e451 Mon Sep 17 00:00:00 2001 From: Adam Berlinger Date: Tue, 2 Apr 2024 18:09:09 +0200 Subject: [PATCH] boards: st: add support for LPTIMER for nucleo_h563zi board LPTIM4 is selected, since it is used only for internal timing and it doesn't support output/input Signed-off-by: Adam Berlinger --- .../nucleo_h563zi/nucleo_h563zi-common.dtsi | 10 +++++++ .../boards/nucleo_h563zi.overlay | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_h563zi.overlay diff --git a/boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi b/boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi index 35fb42aedfa..3e965035626 100644 --- a/boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi +++ b/boards/st/nucleo_h563zi/nucleo_h563zi-common.dtsi @@ -190,3 +190,13 @@ zephyr_udc0: &usb { &vbat { status = "okay"; }; + +&clk_lsi { + status = "okay"; +}; + +stm32_lp_tick_source: &lptim4 { + clocks = <&rcc STM32_CLOCK_BUS_APB3 0x2000>, + <&rcc STM32_SRC_LSI LPTIM4_SEL(4)>; + status = "okay"; +}; diff --git a/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_h563zi.overlay b/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_h563zi.overlay new file mode 100644 index 00000000000..2a2393cfbc9 --- /dev/null +++ b/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_h563zi.overlay @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&usart3 { + /* Set domain clock to HSI to allow wakeup from Stop mode */ + clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>, + <&rcc STM32_SRC_HSI USART3_SEL(3)>; + + /* Configure device as wakeup source */ + wakeup-source; + + /* Configure sleep pinctrl configuration which will be used when + * device is not configured as wakeup source by the application. + * This use case is only applicable in PM_DEVICE mode. + */ + pinctrl-1 = <&analog_pd8 &analog_pd9>; + pinctrl-names = "default", "sleep"; +}; + +&clk_hsi { + /* Make sure HSI is enabled */ + status = "okay"; +};