ncs1.61 peripheral_uart : enable uart when connected and disable uart when disconnected

Hi,

I work with win10 laptop, Toolchain  nrf Connect SDK 1.6.1 on a nrf5340dk.

On peripheral_uart sample, I would like to enable uart when a device is connected and I want to disable uart when device is disconnected to reduce consumption.

There is the consumption mesure by PPK2:

It's seem that between two advertisings the consumption is due to the enable uart.

I need to have the lowest consumption when the nrf5340dk is advertising.

First step, I tryed to disable uart from prj.conf:

CONFIG_SERIAL=n & CONFIG_LOG=n

but after build and download the 4 led were ON and the was no more advertising.

Second step, I tryed to disable uart from the overlay file:

&uart0 {
    status = "disable";

};

but after build and download there was no led on and no more advertising.

There is my project:

5040.peripheral_uart.zip

Could you give me, please,  an example how to enable uart when a device is connected and disable uart when device is disconnected ?

Best regards,

Rob.

Parents Reply Children
No Data
Related