arch/arm/stm32h5: Add USART wake from low power - #20190
Open
liam-geotab wants to merge 4 commits into
Open
liam-geotab wants to merge 4 commits into
liam-geotab wants to merge 4 commits into
Conversation
STM32_OTP_BASE was defined independently in two separate contributions. Remove one. Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
Fix nxstyle issues in arch/arm/src/stm32h5/stm32_serial.c Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
Support USART waking from low power modes, allow keeping HSI running in STOP mode, allow specifying clock source for USARTs, add some missing register and field definitions. stm32 common Kconfigs: Add common STM32 UART config options USARTx_WAKE_FROM_LOW_POWER and USARTx_WUS for USART to cause wake up from low power modes. stm32h5 board configs: Allow board.h to choose the clock source of each USART. Allow board.h to express that HSI should continue running in low power modes. stm32h5 RCC: Set the clock source for each USART if specified in the board configs (STM32_RCC_CCIPR1_USARTxSEL). Keep HSI on in STOP mode if specified in the board configs (STM32_BOARD_HSIKERON_ENABLE). stm32h5 serial driver: Use the new USARTx_WAKE_FROM_LOW_POWER and USARTx_WUS in stm32h5 serial driver to wake from low power modes. Use the USART clock source specified by board configs. Enable FIFOs. Clear UE bit before initialization. Co-authored-by: Javier Casas <javiercasas@geotab.com> Co-authored-by: daniellizewski <daniellizewski@geotab.com> Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
Document the board.h keep-HSI-running-in-stop-mode define STM32_BOARD_HSIKERON_ENABLE and the USART clock source selection defines. Signed-off-by: Liam Howatt <liamhowatt@geotab.com>
liam-geotab
requested review from
jerpelea,
raiden00pl and
simbit18
as code owners
September 18, 2026 21:16
Contributor
|
Sorry about that. I did the MPU work as part of my own OTP work, and left that define in from my test case. It should have occurred to me when I reviewed your PR. |
xiaoxiang781216
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Support USART waking from low power modes (common stm32, stm32h5 only supported for now), allow keeping HSI running in STOP mode (stm32h5), allow specifying clock source for USARTs (stm32h5), add some missing register and field definitions.
stm32 common Kconfigs:
Add common STM32 UART config options USARTx_WAKE_FROM_LOW_POWER and USARTx_WUS for USART to cause wake up from low power modes. Only supported by stm32h5 for now.
stm32h5 board configs:
Allow board.h to choose the clock source of each USART.
Allow board.h to express that HSI should continue running in low power modes.
stm32h5 RCC:
Set the clock source for each USART if specified in the board configs (STM32_RCC_CCIPR1_USARTxSEL).
Keep HSI on in STOP mode if specified in the board configs (STM32_BOARD_HSIKERON_ENABLE).
stm32h5 serial driver:
Use the new USARTx_WAKE_FROM_LOW_POWER and USARTx_WUS in stm32h5 serial driver to wake from low power modes.
Use the USART clock source specified by board configs.
Enable FIFOs.
Clear UE bit before initialization.
Revert a STM32_OTP_BASE define which was duplicated by a separate independent contribution. cc @darrylring.
Impact
It adds new common stm32 configs and stm32h5 board.h defines which, if removed, could break users of them.
stm32_lowputc.c awareness of custom clock source is missing.
Testing
nucleo-h563zi:nshwith the following enabled:Pressing keys causes USART to wake the chip from STOP mode. As you can see from "BCG", the first
'A'printed progress is missing because stm32_lowputc.c is not aware that USART is clocked from HSI yet.