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

Disable logging from prj.conf file

Hi. I want to evaluate the current consumption of the nrf9160 module (I have a Thingy91) and I want to disable all logging functions. I started with the mqtt_simple example and added these lines to the prj.conf file:

CONFIG_LOG=n
CONFIG_SERIAL=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_UART_INTERRUPT_DRIVEN=n

However, I get a compiler error: "undefined reference to z_impl_uart_irq_rx_enable" at line 129 in uart.h

Is this not the correct way of doing it? What am I missing? 

Parents
  • Hi,

    It should be enough to set these:

    CONFIG_LOG=n
    CONFIG_SERIAL=n

  • I still get the same error. I checked out a fresh copy of the mqtt_simple from the v1.1.0 tag. Then I added

    CONFIG_LOG=n
    CONFIG_SERIAL=n

    to the proj.conf file in the nrf9160/mqtt_simple folder 

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    # General config
    CONFIG_TEST_RANDOM_GENERATOR=y
    
    # Logging
    CONFIG_LOG=n
    CONFIG_SERIAL=n
    
    # 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
    
    # BSD library
    CONFIG_BSD_LIBRARY=y
    
    # AT Host
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_AT_HOST_LIBRARY=y
    
    # 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_THREAD_PRIORITY=7
    CONFIG_MAIN_STACK_SIZE=4096
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    

  • That did the trick. Thank you.

    However the average current consumption is toggling between 1,2 and 2,4 mA. I have added lte_lc_edrx_req(true); right after modem_configure(); in the mqtt_simple example.

    I'm using CONFIG_LTE_EDRX_REQ_VALUE="0110". 

    Shouldn't the current consumption at least be below 100uA? 

Reply Children
Related