From 7be1a8119bfd43810aae71a04670e40c0cc4e04b Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Tue, 21 Nov 2023 17:03:23 +0100 Subject: [PATCH] samples: stm32: serial_wakeup: b_u585i_iot02a support Add a sample overlay for b_u585i_iot02a Signed-off-by: Erwan Gouriou --- .../boards/b_u585i_iot02a.overlay | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 samples/boards/stm32/power_mgmt/serial_wakeup/boards/b_u585i_iot02a.overlay diff --git a/samples/boards/stm32/power_mgmt/serial_wakeup/boards/b_u585i_iot02a.overlay b/samples/boards/stm32/power_mgmt/serial_wakeup/boards/b_u585i_iot02a.overlay new file mode 100644 index 00000000000..cce711c785c --- /dev/null +++ b/samples/boards/stm32/power_mgmt/serial_wakeup/boards/b_u585i_iot02a.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&cpu0{ + /* USART Wakeup requires automatic HSI16 switch on in deepsleep mode + * which isn't possible in Stop Mode 2. + * Remove Stop Mode 2 from supported modes + */ + cpu-power-states = <&stop0 &stop1>; +}; + +&usart1 { + /* Set domain clock to HSI to allow wakeup from Stop mode */ + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>, + <&rcc STM32_SRC_HSI16 USART1_SEL(2)>; + + /* 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_pa9 &analog_pa10>; + pinctrl-names = "default", "sleep"; +}; + +&clk_hsi { + /* Make sure HSI is enabled */ + status = "okay"; +};