Current in sleep mode

Dear Sirs,

Environment:
- Board: Actinious Icarus SOM
- Toolchain V2.1.3
- Board files BFUP-v1.2.1-nrf-2.1.x

On my project based on nrf9160, I have problems with power consumption in sleep mode.
I reduce all necessary functions and extract problem on this.

Loop
- Do something
- Sleep (current problem)

Test 1: Do something was only LED pulse

Prj.conf:
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_PM=y
CONFIG_GPIO=y
CONFIG_SERIAL=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_LOG=n
CONFIG_NRF_MODEM_LIB=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y

The current was in line with expectations: Vin <3uA, Vcc < 1uA

Test 2: Do something: Send few characters on uart0 and also on uart3

Of course in Prj.conf I include:

CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y

Current in sleep mode increases to several hundred uA
Then I add before sleep

NRF_UARTE0->ENABLE = 0;
NRF_UARTE1->ENABLE = 0;
NRF_UARTE2->ENABLE = 0;
NRF_UARTE3->ENABLE = 0;

And after sleep
NRF_UARTE0->ENABLE = 8;
NRF_UARTE3->ENABLE = 8;

In sleep mode current drop to approximately 100 uA.
I made several test with different configurations like:

NRF_UARTEx->TASKS_STOPRX = 1;
CONFIG_UART_x_NRF_ASYNC_LOW_POWER=y
…
The same result.

Question 1
How could completely switch off serial devices programmatically before sleep. It is obvious that it is possible to consume almost no power if CONFIG_SERIAL=n. For me it is totally illogical to have ability to disconnect serial only during compilation.

Question2
Please send me example how to switch off uarts. (Simple as possible CONFIG_UART_ASYNC_API=y)

Note.
Nrf/samples/peripheral/lpuart - does not compile on 2.1.3. Some meaningless messages about errors.

best regars, Jaro Kapus

Related