Skip to content

PM: drivers require a mechanism to reinitialize when transitioning between PM states #59194

@knthm

Description

@knthm

Describe the bug

The peripherals on many SoCs lose register contents (and additional bus configuration) when entering low-power modes, even though RAM contents and general OS state is persisted.

The drivers for these peripherals need a mechanism for reinitializing the partial configuration lost.

Example:

With CONFIG_PM enabled on STM32* series, accessing certain peripherals after returning from STOP2 to RUN mode will fail.

To Reproduce

  1. Choose a sample on an SoC utilizing an affected peripheral, e.g. SPI/I2C1-2/ADC/SUBGHZSPI-LoRa on STM32WL
  2. Enable CONFIG_PM and build
  3. Run the sample, and observe peripheral accesses failing after the SoC has entered and left STOP2 mode

Expected behavior

Peripherals operate correctly after the SoC returns from a low-power mode.

Impact

  • Only select low-power modes are usable when these certain peripherals are utilized

Environment (please complete the following information):

  • OS: Arch Linux, kernel 6.3.4-arch1-1
  • Toolchain: Zephyr-SDK 0.16.1
  • Commit: HEAD of main
  • Board: Olimex LoRa-STM32WL-DevKit

Related issues

### Tasks
- [ ] https://github.com/zephyrproject-rtos/zephyr/pull/60369
- [ ] https://github.com/zephyrproject-rtos/zephyr/pull/60998
- [ ] https://github.com/zephyrproject-rtos/zephyr/pull/59200
- [ ] https://github.com/zephyrproject-rtos/zephyr/pull/61680

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions