Hi!
Working on a BT peripheral device that will work in two modes depending on a runtime check at startup:
Sending data over BLE, running on battery (UART unused).
Sending data over UART, externally powered.
Currently this is running using NRF sdk 1.7.,1 and we are working on updating to 2.1.
During this update we see a higher power consumption when enabling the CONFIG_UART_ASYNC_API after the update in the first case (so UART is not used).
old SW using sdk 1.7.1:
UART-related config:
CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE0=y CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_LOG=n CONFIG_LOG_BACKEND_UART=n
Devicetree:
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = <115200>;
tx-pin = <20>;
rx-pin = <22>;
//rts-pin = <5>;
//cts-pin = <7>;
};
Measured average consumption (after startup/connecting): 26.5 uA
New SW using SDK 2.1 without CONFIG_UART_ASYNC_API:
UART-related config:
CONFIG_PINCTRL=y CONFIG_NRFX_UARTE0=y CONFIG_UART_NRFX=n #CONFIG_UART_ASYNC_API=y CONFIG_CONSOLE=n CONFIG_LOG=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_LOG_BACKEND_UART=n
Devicetree:
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
Devicetree-pincontrol:
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RX, 0, 22)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RX, 0, 22)>;
low-power-enable;
};
};
Measured average consumption (after startup/connecting): 25.2 uA
New SW using SDK 2.1 with CONFIG_UART_ASYNC_API:
Also require to remove CONFIG_UART_NRFX=n
Devicetree wasn't changed from case above.
CONFIG_PINCTRL=y CONFIG_NRFX_UARTE0=y #CONFIG_UART_NRFX=n CONFIG_UART_ASYNC_API=y CONFIG_CONSOLE=n CONFIG_LOG=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_LOG_BACKEND_UART=n
Measured average consumption (after startup/connecting): 45.9uA
In this case adding a call to rx_disable changes the consumption very little.
Can you see any problem in our configuration?
Can you provide any support on how to configure it to bring the consumption down in the same range as for the old sdk but still be bale to use the async api?
Is there anything else we can do to disable the uart in the case where we do not use it?
Tried configuring the uart gpio-s using GPIO api at startup in the case when not using it, this doesn't seem to be possible.
Is there any way to completely turn off or disable UART in runtime or have it as disabled in the devicetree and enable it in runtime?
BR,
Mårten