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
  • Hello Robert,

    Good Morning. 

    Sorry I had a typo in my reply. Instead of witing network core I wrote application core  2times.

    Actually, I meant that you have to add CONFIG_SERIAL=n in your hci_rpmsg.conf file. That means you disable the SERIAL from network core.

    ''I'm not sure to understand your reply, I tryed to coment  "#CONFIG_SERIAL=y" and  "#CONFIG_SERIAL=n" into prj.conf, so I have no config_serial.''

    Yes, this is correct set up in prj.conf.  

    Could you please try this first ? 1. #CONFIG_SERIAL=y" and  "#CONFIG_SERIAL=n" into prj.conf  2.  CONFIG_SERIAL=n in your hci_rpmsg.conf file

    'Do you know what I should do to wake up the uart ?'' -- I will look at tis new query soon.

     

    Best Regards

    Kazi Afroza Sultana

Reply
  • Hello Robert,

    Good Morning. 

    Sorry I had a typo in my reply. Instead of witing network core I wrote application core  2times.

    Actually, I meant that you have to add CONFIG_SERIAL=n in your hci_rpmsg.conf file. That means you disable the SERIAL from network core.

    ''I'm not sure to understand your reply, I tryed to coment  "#CONFIG_SERIAL=y" and  "#CONFIG_SERIAL=n" into prj.conf, so I have no config_serial.''

    Yes, this is correct set up in prj.conf.  

    Could you please try this first ? 1. #CONFIG_SERIAL=y" and  "#CONFIG_SERIAL=n" into prj.conf  2.  CONFIG_SERIAL=n in your hci_rpmsg.conf file

    'Do you know what I should do to wake up the uart ?'' -- I will look at tis new query soon.

     

    Best Regards

    Kazi Afroza Sultana

Children
Related