QSPI NOR power manager errrors when CONFIG_PM_DEVICE_RUNTIME is set

I recently enabled power management in my code base by adding these two oiptions to my prj.conf:

CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
The code runs on an nRF5340 MCU with a LittleFS instance in an external MX25R64 QSPI flash. It all worked fine until I enabled the two options above in prj.conf, now I get this error each time the MCU starts:
<err> qspi_nor: pm_device_runtime_put failed: -16
It appears that things continue to work normally though, but I've yet to run extensive read/write tests on the external flash and the above error is a bit concerning. I also have 
CONFIG_NORDIC_QSPI_NOR_XIP=y in my prj.conf, which (among other things) is supposed to keep the external flash from sleeping if I understood correctly (I need this for various reasons). 
Does anybody know how concerned I should be about this error? Thank you.
EDIT: sorry, forgot to specify: I am using Nordic Connect SDK 2.7.0.
Parents
  • Hi

    Error message -16 points to the device or resource you're calling being busy, so it seems the QSPI is doing something when the pm_device_runtime_put() function is being called in your project. If you don't intend to suspend the device, like this function does, you should find out where and why it's being called, as something in your application is trying to put the device in a suspended state.

    Best regards,

    Simon

  • Hi SImon,

    Thabks for your reply. I agree with the first part of your answer: indeed, it seems like the QSPI NOR device is busy when pm_device_runtime_put is being called. However, I disagree with "something in your application is trying to put the device in a suspended state", because I don't do any explicit power management on the QSPI NOR in my application. And I don't think I should, because I believe that the QSPI NOR driver (and maybe some lower level drivers) should do this automatically. If my applcation should actually be involved in this process, please let me know how.

    Thanks,
    Bogdan

    EDIT: also, remember what I said earlier: in my application, I don't actually want the QSPI NOR to go to sleep, which is why I set CONFIG_NORDIC_QSPI_NOR_XIP=y. It is my understanding that this configuration option should prevent the QSPI NOR from sleeping. If this is correct, then the driver shouldn't attempt to put it to sleep at all. 

Reply
  • Hi SImon,

    Thabks for your reply. I agree with the first part of your answer: indeed, it seems like the QSPI NOR device is busy when pm_device_runtime_put is being called. However, I disagree with "something in your application is trying to put the device in a suspended state", because I don't do any explicit power management on the QSPI NOR in my application. And I don't think I should, because I believe that the QSPI NOR driver (and maybe some lower level drivers) should do this automatically. If my applcation should actually be involved in this process, please let me know how.

    Thanks,
    Bogdan

    EDIT: also, remember what I said earlier: in my application, I don't actually want the QSPI NOR to go to sleep, which is why I set CONFIG_NORDIC_QSPI_NOR_XIP=y. It is my understanding that this configuration option should prevent the QSPI NOR from sleeping. If this is correct, then the driver shouldn't attempt to put it to sleep at all. 

Children
No Data
Related