zephyr: CONFIG_PM Freezes my application

Describe the bug

Using a custom board with STM32WB55RGV6, I have an application that uses lorawan, it connects, then it enters a loop of sending a payload every couple of minutes. Now, I need to make the device go into STOP2 for the couple of minutes it does nothing and just adding CONFIG_PM=y to my conf file breaks everything. I don’t see logs, chirpstack doesn’t receive any packets, nothing, not even a request to join. I tried resuming usart1 to see logs, I tried pm_device_runtime_get(), and pm_device_runtime_put(), I tried,

    // if (device_is_ready(uart))
    // {
    //     pm_device_action_run(uart, PM_DEVICE_ACTION_RESUME);
    // }

And don’t know what to do next. I’m on Zephyr 4.1.0 right now, on zephyr 3.7.0 the workaround code above worked but not in this version.

Regression

  • This is a regression.

Steps to reproduce

Just enabling CONFIG_PM in prj.conf for STM32WB55RGV6.

Relevant log output


Impact

Major – Severely degrades functionality; workaround is difficult or unavailable.

Environment

  • OS : Windows 11
  • Board : Custom board with STM32WB55RGV6
  • Zephyr 4.1.0

Additional Context

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

I’m gonna check for the power save modes. As for the config I tried with and without CONFIG_PM_DEVICE_RUNTIME , nothing changed.

What strange thing I observed is that when I add CONFIG_LOG_DEFAULT_LEVEL=4 so the DBG logs should show up, the device connects to the LoRaWAN gateway, the payload has been sent etc… The moment I switch to another log level, it just breaks.