Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

UART Data byte corrupt when calling nrf_pwr_mgmt_run(); in main while loop.

I am using nRF52805(SDK 17.0.1 & S112) in my application development. Designed GATT Table Having some custom services with read, write & notify properties, And also, there is some data communication in between nRF52805 & Host Microcontroller via UART interface(libUARTE is used for handling all communication) for updating custom characteristics, I need to do power optimization as device is battery operated, so power management is initialized by "power_management_init();" function & everything working fine until I'm calling nrf_pwr_mgmt_run(); in main while loop . But upon calling "nrf_pwr_mgmt_run();"  some UART data byte got corrupted (I'm suspecting) & some times application gets stuck(may be goes into unknown/unrecoverable state). Also, I'm suspecting some kind of event time handling issue between softdevice & application interrupts.

My question is below:

  1. is there any limitation of using libUARTE in Power Management mode.
  2. I also tried app_uart for my application and facing same kind of issue, so is there any better way to handle heavy transection of data on UART having ble stack enabled.
  3. In power management (when calling nrf_pwr_mgmt_run();) need some specific setting to reduce current consumption & How it is working in real scenario.  

please suggest me for above points.

Thanks.

Parents
  • Hi

    I'm not sure I understand. Do you try running the libUARTE peripheral when you have called the nrf_pwr_mgmt_run() function? This will likely not work. The recommended approach is to uninitialize the driver and then call the nrf_pwr_mgmt_run() function to go into idle mode either for a set amount of time or until it is woken up by an external event. Then you can reinitialize it once the device wakes up.

    Best regards,

    Simon

  • thanks for reply Simonr.

    Yes, I'm using libUARTE peripheral and also calling nrf_pwr_mgmt_run(). for reducing current consumption. As I understood, I need to follow below steps in main while(1) loop?

    1. uninitialize libUARTE peripheral by calling "nrf_libuarte_async_uninit()".
    2. call " nrf_pwr_mgmt_run()"
    3. again, initialize libUARTE peripheral by calling "nrf_libuarte_async_init()".

    Also in that case, What will be the wake up(external event) source, do I need to configure it?

Reply
  • thanks for reply Simonr.

    Yes, I'm using libUARTE peripheral and also calling nrf_pwr_mgmt_run(). for reducing current consumption. As I understood, I need to follow below steps in main while(1) loop?

    1. uninitialize libUARTE peripheral by calling "nrf_libuarte_async_uninit()".
    2. call " nrf_pwr_mgmt_run()"
    3. again, initialize libUARTE peripheral by calling "nrf_libuarte_async_init()".

    Also in that case, What will be the wake up(external event) source, do I need to configure it?

Children
No Data
Related