zephyr icon indicating copy to clipboard operation
zephyr copied to clipboard

stm32: Add support for serial PM actions and wakeup support

Open erwango opened this issue 3 years ago • 1 comments

This PR adds support and demonstrates use of serial PM actions and use of serial as wakeup source

Points of attention on feature implementation in usart_stm32.c

  • A new config field wakeup_source is added. This is redundant with pm_device API's flag PM_DEVICE_FLAG_WS_CAPABLE. Reason is that wakeup capability should actually be available with CONFIG_PM while PM_DEVICE_FLAG_WS_CAPABLE are only available if CONFIG_PM_DEVICE is enabled. In order to simplify driver code, it is kept even if CONFIG_PM_DEVICE is enabled. But in this case, pm_device_wakeup_enable APIs prevails.
  • In treatment of PM_ACTION_SUSPEND, if peripheral is not configured with a "sleep" pinctrl state, a warning is generated, but this doesn't prevent core transition to low power PM state. See dedicated commit for more details

erwango avatar Aug 03 '22 15:08 erwango

^^@r2r0

erwango avatar Aug 03 '22 15:08 erwango