Unable to migrate to RTT and now unable to restore UART console

I was trying to migrate to RTT on the nRF52840DK because my actual target has no UART. I changed prj.conf as shown:

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
And while the RTT viewer connects without error, there is no console output. The more troubling development is that when I tried to go back to UART output as a sanity check, I now have no console output there either. (prj.conf shown below)
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=n
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
The program is running, so there should be console output, and I have spent hours looking through your documentation and Q&A but everything I am told to do I have already done.
I know it is the Nordic way to have a dozen or so things that have to be just right in order for a certain feature to work. Can you please enumerate any and all configuration items that must be set properly, e.g. baud rates, handshake, memory addresses (for RTT) so I can go through them one by one and check to see where I have gone wrong?
Thanks.
Parents Reply Children
  • It was more a general request to provide a checklist that I or any other developer might consult when trying to debug console problems, but if you would like to help in this specific case, I am using SDK 2.1.2 With Zephyr RTOS, developing on Windows using nRF Connect on Visual Studio Code. The board is a nRF52840DK connected via USB. The code in nrf52840dk_nrf52840_defconfig is (I think) unchanged with:

    # SPDX-License-Identifier: Apache-2.0

    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52840_QIAA=y
    CONFIG_BOARD_NRF52840DK_NRF52840=y

    # Enable MPU
    CONFIG_ARM_MPU=y

    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y

    # Enable RTT
    CONFIG_USE_SEGGER_RTT=y

    # enable GPIO
    CONFIG_GPIO=y

    # enable uart driver
    CONFIG_SERIAL=y

    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y

    # additional board options
    CONFIG_GPIO_AS_PINRESET=y

    CONFIG_PINCTRL=y
    My prj.conf for this project is:
    CONFIG_NCS_SAMPLES_DEFAULTS=y

    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=n
    CONFIG_LOG=y
    CONFIG_LOG_MODE_MINIMAL=y

    CONFIG_BT=y
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_L2CAP_TX_BUF_COUNT=5
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="RBI"
    CONFIG_BT_DEVICE_APPEARANCE=962
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

    # Enable the LBS service
    CONFIG_BT_LBS=n
    CONFIG_BT_LBS_POLL_BUTTON=n
    CONFIG_DK_LIBRARY=y

    #USB related configs
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
    #CONFIG_LOG=y
    CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
    CONFIG_USB_MASS_STORAGE=y
    CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y

    CONFIG_MAIN_STACK_SIZE=1536

    #CONFIG_APP_MSC_STORAGE_RAM=y
    CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y
    CONFIG_DISK_VOLUME_SIZE=0x800000
    I did re-flash the S140 soft device version 7.3.0.
    The nrf52840dk exposes 2 com ports and I have connected both to the nRF Terminal with baud 115200 8 bits no parity, no rts/cts.
    I don't know if it is relevant, but my Kconfig for this project contains:
    config USB_DEVICE_PID
        default USB_PID_MASS_SAMPLE

    config APP_WIPE_STORAGE
        bool "Option to clear the flash area before mounting"
        help
          Use this to force an existing file system to be created.

    choice
        prompt "Storage and file system type used by the application"
        default APP_MSC_STORAGE_NONE
        help
          Specify the type of storage and file system.

    config APP_MSC_STORAGE_NONE
        bool "Use RAM disk as block device"
        imply DISK_DRIVER_RAM

    config APP_MSC_STORAGE_RAM
        bool "Use RAM disk and FAT file system"
        imply DISK_DRIVER_RAM
        imply FILE_SYSTEM
        imply FAT_FILESYSTEM_ELM

    config APP_MSC_STORAGE_FLASH_FATFS
        bool "Use FLASH disk and FAT file system"
        imply DISK_DRIVER_FLASH
        imply FILE_SYSTEM
        imply FAT_FILESYSTEM_ELM

    config APP_MSC_STORAGE_FLASH_LITTLEFS
        bool "Use FLASH disk and LittleFS"
        imply DISK_DRIVER_FLASH
        imply FILE_SYSTEM
        imply FILE_SYSTEM_LITTLEFS

    config APP_MSC_STORAGE_SDCARD
        bool "Use SDHC and FAT file system"
        imply DISK_DRIVER_SDMMC
        imply FILE_SYSTEM
        imply FAT_FILESYSTEM_ELM

    endchoice

    config DISK_RAM_VOLUME_SIZE
        default 32 if APP_MSC_STORAGE_NONE

    config MASS_STORAGE_DISK_NAME
        default "NAND" if DISK_DRIVER_FLASH
        default "RAM" if DISK_DRIVER_RAM
        default "SD" if DISK_DRIVER_SDMMC

    if DISK_DRIVER_FLASH

    config FLASH_MAP
        default y

    config FLASH_PAGE_LAYOUT
        default y

    config DISK_FLASH_START
        default 0x0

    config FLASH_LOG_LEVEL
        default 3

    if NORDIC_QSPI_NOR

    config NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE
        default 4096

    config DISK_FLASH_DEV_NAME
        default "MX25R64" if "$(dt_nodelabel_enabled,mx25r64)"
        default "GD25Q16" if "$(dt_nodelabel_enabled,gd25q16)"

    config DISK_VOLUME_SIZE
        default 0x100000

    config DISK_FLASH_MAX_RW_SIZE
        default 4096

    config DISK_FLASH_ERASE_ALIGNMENT
        default 0x1000

    config DISK_ERASE_BLOCK_SIZE
        default 0x1000

    endif # NORDIC_QSPI_NOR

    endif # DISK_DRIVER_FLASH

    source "Kconfig.zephyr"
    Is there anything else you would like to know?
  • # Config logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_DEFAULT_LEVEL=3

    I use this conf to run RTT debuger

Related