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

Adding MCUBOOT Bootloader to Peripheral UART example stops SES IDE RTT debug terminal output

nRF Connect SDK v1.6.1 

HW - nRF 52832 DK

Host OS - Ubuntu 18.04 LTS

SES IDE Nordic Edition v5.60 with Segger J-Link USB

If I build the Peripheral UART example then RTT debug logging in SES IDE terminal works.  When I add the MCUBOOT Bootloader to the project to add MCUMgr DFU then

the RTT logging stops in the SES IDE terminal.

Below are my proj.conf settings:   Setting CONFIG_BOOTLOADER_MCUBOOT=y is what causes the RTT debug logging in SES to stop working.  What additional proj.conf settings

do I require for RTT logging to work in IDE ?

# FW version
CONFIG_MCUBOOT_IMAGE_VERSION="0.9.1"

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
CONFIG_SERIAL=y

CONFIG_GPIO=y

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Diversey_UART_DFU"
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

# Enable the NUS service
CONFIG_BT_NUS=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# Enable and Config logger
CONFIG_LOG=y

# Make sure printk is not printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_LOG_PRINTK=n
# Enable Segger J-Link RTT debug terminal in SES IDE
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_ASSERT=y

# added for FOTA
# Must enable MCUBOOT bootloader for DFU to work else mobile error message Invalid Response:{"images":{}, "splitStatus":0}
# Must use split images to swap images out when upload of image completes
CONFIG_BOOTLOADER_MCUBOOT=y       # Adding MCUBOOT bootloader CONFIG_BOOTLOADER_MCUBOOT=y stops RTT debug terminal output in IDE terminal
CONFIG_MCUMGR=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n # n=disables the pairing requirement with mobile device
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Increase the MTU size for DFU
# CONFIG_BT_BUF_ACL_RX_SIZE=251
# CONFIG_BT_BUF_ACL_TX_SIZE=251
# CONFIG_BT_L2CAP_TX_MTU=247
# CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

# Increase the MTU size and Data Len params for faster DFU
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_RX_BUFFERS=2
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

CONFIG_BT_THROUGHPUT=y
CONFIG_BT_GATT_DM=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n

# Diversey increased from 2048 to 4096 for MCUMgr DFU
CONFIG_HEAP_MEM_POOL_SIZE=4096

  • Hi,

    Do you by any chance use RTT logging in MCUBoot as well as in your application? If so, that could cause problems. In that case, the easiest fix is to disable RTT logging in MCUBoot.

  • I am using the defaults in prj.conf for MCUBoot.   I did not enable it in the prj.conf file for ncs/bootloader/mcuboot/boot/zephyr/

    MCUBoot proj.conf Settings:

    CONFIG_CONSOLE_HANDLER=y
    CONFIG_SYSTEM_CLOCK_DISABLE=y
    CONFIG_SYS_POWER_MANAGEMENT=n

    CONFIG_MAIN_STACK_SIZE=10240
    CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

    CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
    CONFIG_BOOT_ENCRYPT_RSA=n
    CONFIG_BOOT_ENCRYPT_EC256=n
    CONFIG_BOOT_ENCRYPT_X25519=n

    CONFIG_BOOT_UPGRADE_ONLY=n
    CONFIG_BOOT_BOOTSTRAP=n

    ### mbedTLS has its own heap
    # CONFIG_HEAP_MEM_POOL_SIZE is not set

    ### We never want Zephyr's copy of tinycrypt. If tinycrypt is needed,
    ### MCUboot has its own copy in tree.
    # CONFIG_TINYCRYPT is not set
    # CONFIG_TINYCRYPT_ECC_DSA is not set
    # CONFIG_TINYCRYPT_SHA256 is not set

    CONFIG_FLASH=y
    CONFIG_FPROTECT=y

    ### Various Zephyr boards enable features that we don't want.
    # CONFIG_BT is not set
    # CONFIG_BT_CTLR is not set
    # CONFIG_I2C is not set

    CONFIG_LOG=y
    CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL
    ### Ensure Zephyr logging changes don't use more resources
    CONFIG_LOG_DEFAULT_LEVEL=0
    ### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y
    CONFIG_CBPRINTF_NANO=y

  • Hi,

    It should work if you disable RTT by adding this to your application's CMakeLists.txt:

    set(mcuboot_CONF_FILE prj.conf ${CMAKE_CURRENT_LIST_DIR}/mcuboot.conf)

    and create a file named mcuboot.conf in the same location (your application folder) which you populate with:

    CONFIG_USE_SEGGER_RTT=n

Related