This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Lowering the power consumption of nRF9160 mqtt_simple(NCS 1.3.0)

I  turned off the serial in prj.conf of the mqtt_simple routine.

<prj.conf>

#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_MODE_NBIOT=y
CONFIG_LTE_LEGACY_PCO_MODE=y

# BSD library
CONFIG_BSD_LIBRARY=y

# AT Host
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=n

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=n

# Appliaction
#CONFIG_MQTT_PUB_TOPIC="/my/publish/topic"
#CONFIG_MQTT_SUB_TOPIC="/my/subscribe/topic"
#CONFIG_MQTT_CLIENT_ID="my-client-id"
#CONFIG_MQTT_BROKER_HOSTNAME="mqtt.eclipse.org"
#CONFIG_MQTT_BROKER_PORT=1883

# Main thread
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_LOG=n
CONFIG_SERIAL=n

<nrf9160dk_nrf9160ns.overlay>

&uart0 {
    status = "disabled";
};
&uart1 {
    status = "disabled";
};

The idle current was measured at 500UA. This means that the serial port was not closed successfully. 

I follow this blogClose it and start with the main function. The idle current is 6UA.

void disable_uart(){
	NRF_UARTE0->ENABLE = 0;
    NRF_UARTE1->ENABLE = 0;
}

Why can't the first method close the serial port?

Parents Reply Children
No Data
Related