This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RTT logs not shown when CONFIG_BOOTLOADER_MCUBOOT=y

I have followed Einar's response on the below thread but I still cannot see the logs on the SES

https://devzone.nordicsemi.com/f/nordic-q-a/79682/adding-mcuboot-bootloader-to-peripheral-uart-example-stops-ses-ide-rtt-debug-terminal-output

I have run a sample code running fota based on nRF Connect SDK v1.8.0 where the recommended solution has been implemented.

Unfortunately, it does not work. Could you share a code sample for v1.8.0 where MCUBOOT is in use and the logs of the main app are shown in the debug terminal.

Thanks for your help

Parents Reply Children
  • Unfortunately, I cannot get this to work. I have added some extra lines error checking on CMakeList.txt file

    #===============================================================================
    # set mcuboot.conf
    #===============================================================================
    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/prj.conf")
    	if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
    	  set(mcuboot_CONF_FILE
    		${CMAKE_CURRENT_LIST_DIR}/prj.conf
    		${CMAKE_CURRENT_LIST_DIR}/mcuboot.conf)
    	else()
    	  message(FATAL_ERROR "Missing mcuboot.conf file")
    	endif()
    else()
      message(FATAL_ERROR "Missing prj.conf file")
    endif()

    No warning triggers when running CMake. There is a single line in the mcuboot.conf file

    CONFIG_USE_SEGGER_RTT=n

    However on SES>Project>Configure nRF Connect SDK Project ... In the mcuboot_menuconfig target, the USE_SEGGER_RTT stills appears as enabled:

    Disabling that line will bring back the logs. That solves the issue locally but I am working on a shared repo and I would like CMake to work correctly.

    Could you check if mcuboot_CONF_FILE is still a valid parameter for v1.8.0?

    Thank you

  • Hi,

    I did not get a chance to look at this today, but will do so tomorrow. Which IC are you using?

  • Thanks, Einar. I am running the code on an nRF52DK (nRF52832) board.

  • I see. This should work then, and the default configuration in 1.8.0 does not use RTT in the bootloader. I just did a test with NCS 1.8.0 and the example in the tutorial - peripheral_lbs. If you follow the guide for BLE DFU, but also add the lines for RTT logging, it should work out of the box.

    I my case I end up with this prj.conf:

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_LBS"
    
    # Enable the LBS service
    CONFIG_BT_LBS=y
    CONFIG_BT_LBS_POLL_BUTTON=y
    CONFIG_DK_LIBRARY=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Enable mcumgr.
    CONFIG_MCUMGR=y
    
    # Enable most core commands.
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    
    # Ensure an MCUboot-compatible binary is generated.
    CONFIG_BOOTLOADER_MCUBOOT=y
    
    # Allow for large Bluetooth data packets.
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256
    
    # Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    
    # Some command handlers require a large stack.
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    
    # Disable UART Console and enable the RTT console
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y
    

    And get this RTT output (which is from the application and as expected):

    00> *** Booting Zephyr OS build v2.7.0-ncs1  ***
    00> Starting Bluetooth Peripheral LBS example
    00> build time: Jan 27 2022 12:35:59
    00> I: 2 Sectors of 4096 bytes
    00> I: alloc wra: 0, fe8
    00> I: data wra: 0, 0
    00> I: SoftDevice Controller build revision: 
    00> I: df c0 4e d6 1f 7c 66 09 |..N..|f.
    00> I: 0a f5 2b a0 98 f2 43 64 |..+...Cd
    00> I: 62 c5 a6 2a             |b..*    
    00> I: No ID address. App must call settings_load()
    00> Bluetooth initialized
    00> Advertising successfully started

    There should not even be a need to do any changes for the bootloader, as it does not do RTT logging by default.

    Does this work in your case if you follow the exact same steps?

Related