zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.48k stars 6.42k forks source link

drivers: spi: stm32: Broken device power management on SPI bus #77196

Open hubpav opened 3 weeks ago

hubpav commented 3 weeks ago

With PR #72991, the SPI driver does not work with PM device + runtime features enabled.

The bug was reproduced on the STM32WL device.

Steps to reproduce:

  1. In samples/subsys/lorawan/class_a add CONFIG_PM_DEVICE=y and CONFIG_PM_DEVICE_RUNTIME=y to prj.conf.

  2. Build the sample: west build -b lora_e5_mini

  3. Debug the sample (west debug), set the breakpoint to the main function b main, and run the code.

  4. The main function is never hit as it is stuck in the SPI driver (spi_ll_stm32.c:878 - in transceive function).

When I reverted the commit 858e8c51f1f42abb0afe62a4d701e69b7a6bd2b1 from PR #72991, the sample works as expected even with the above PM device options enabled.

github-actions[bot] commented 3 weeks ago

Hi @hubpav! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

erwango commented 3 weeks ago

@aurel32 FYI