UART and Logger

I want to use the UART to receive data, but that doesn't look possible if I use the Logging Module.   I don't see where the logger module will interrupt my code to tell me I've received a character.

So must I disable the Logger to gain full interrupt control of the UART?

  • I'm not having success make the esb_ptx sample use the RTT instead of the UART.  I've pasted the configuration you recommended into prj.conf as you recommended:

    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_ESB=y
    CONFIG_DK_LIBRARY=y
    CONFIG_CLOCK_CONTROL=y

    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    The esb_ptx application still writes out the uart and not the RTT.   
    I get the following problems reported:

    Any idea why it's not working?

  • Hi James,

    Could you try adding the following as well:

    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_LOG_PRINTK=y
     Ensure you're using the correct tool to view RTT output. The standard UART terminal won't show RTT logs. You need to use a tool like SEGGER's RTT Viewer or J-Link RTT Viewer or the RTT Console in nRF Connect for VS Code to see the RTT output.
    Regards,
    Swathy
Related