How to enable/disable the UART with NCS/Zephyr

My BLE application needs to communicate with another µC using serial UART - so I started my app based on the sample in bluetooth/peripheral_Uart
I'm have a nRF52_DK board (52832) and a custome hardware with the same features for testing.
I'm currently using NCS 1.9.1 with SES - (I'm not planning to change to NCS 2.x.x or VS Code for many reasons !)

The app works fine - but we need to run the whole thing later on a CR2032 battery and the power consumption is too high.

The nordic chip consumes approx 2.4 mA while doing nothing - and I noticed this is caused by the UART. When I do not init the UART, the application runs at 0.12 mA - I measure current via P22 on the nRF52_DK board.

My application has 2 GPIO pins already connected to the other µC and so I'm able to handshake and determine when to enable/disable the UART - I just have no idea what would the preferred way to do this ... can someone please help ?

thanks, Matthias

Parents
  • Hello

    I had a look at this other article, but nothing I tried helped me.

    I managed to get around the exception  - I'm not sure what I did, but I guess the LPUART feature was not enabled in Config - but now I have the issue that the GPIOs are not longer working.

    When my application is idle for more than 20 seconds (which means, there is not BLE connect) I going into PM_DEVICE_ACTION_SUSPEND and this seems to work because tge current goes to some 10 µA

    I'm trying to use GPIO Port P0.07 for wakeup, simply by checking the Port signal in my main loop and this does not longer work. It works well without PM_DEVICE_ACTION_SUSPEND, although this refers to device_get_binding ("UART_0") but it appears as if the whole chip goes into some deep sleep mode. The only way to wake up seems a hardware reset.

    The examples for LPUART seem to have a built-in wakeup behaviour - but I cant use this.

    can you tell me how to use the GPIOs while the UART is suspended ?

    thanks, Matthias

  • Hi,

    The System can be woken up, when in System OFF mode, only by certain peripherals. You can refer the System OFF mode documentation for this.

    -Priyanka

Reply Children
No Data
Related