Issue initializing UART after enabling mcumgr serial transport

Hello,

We have recently decided to transition from nRF5 SDK to nRF Connect SDK to develop a simple application that is able to respond with its FW version when requested via UART, and to receive upgrades via serial communication. We use a device based on nRF52840 and we based the application on NUS Central UART example as a starting point. We added the functionality to handle custom requests for the FW version over UART.

After we successfully tested this functionality, we decided to use this guide posted by Simon to add serial DFU functionality to the application. In the guide Simon suggests to add this configuration CONFIG_MCUMGR_SMP_UART to prj.conf and enable it by setting its value to 'y' in order to enable the serial mcumgr transport. It seems like enabling this prevents the UART module from being initialized anymore at start up, and the call to uart_callback_set(uart, uart_cb, NULL) returns an error. We tracked the issue further and noticed that inside that routine the callback check done on line 1240 returns NULL. This only occurs when we enable CONFIG_MCUMGR_SMP_UART. Below is the code snippet where the error was discovered.

if (api->callback_set == NULL) {

        return -ENOSYS;
    }
I am including the rest of the settings from prj.conf.
#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable mcumgr
CONFIG_MCUMGR=y

# Enable most core commands.
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y

# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y

# Enable the BLE stack with GATT Client configuration
CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_SMP=y
CONFIG_BT_GATT_CLIENT=y

# Enable the BLE modules from NCS
CONFIG_BT_NUS_CLIENT=y
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1
CONFIG_BT_GATT_DM=y
CONFIG_HEAP_MEM_POOL_SIZE=2048

# This example requires more workqueue stack
# CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

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

# Config logger
CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_ASSERT=y

# #Enable immutable bootloader
# CONFIG_SECURE_BOOT=y
# #Enable upgradable bootloader
# CONFIG_BOOTLOADER_MCUBOOT=y
# #Use minimum partition
# CONFIG_B0_MIN_PARTITION_SIZE=y
# #Automatically generate pre-signed variants
# CONFIG_BUILD_S1_VARIANT=y
# #Enable signing the firmware image with the private key located at the project relative location
# CONFIG_SB_SIGNING_KEY_FILE="../../../keys/priv.pem"

#Enable the serial mcumgr transport.
CONFIG_MCUMGR_SMP_UART=y
#Disable UART Console and enable the RTT console
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y

#Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
We are wondering what is the reason that we are unable to enable DFU over serial inside of an application that uses the UART? Furthermore, if this approach is not feasible, can you provide some guidance to help us remedy the issue we are seeing?
Thank you!
Related