Warnings when building with sysbuild to enable DFU over BLE (CONFIG_DISABLE_FLASH_PATCH, mcuboot flags)

Hi,

I have a BLE application where I want to use the device firmware updates (DFU) over Bluetooth. I followed the nRF Connect SDK Intermediate tutorial on how to enable the DFU. However, I got some warnings and errors along the way that I cannot resolve and also do not completely understand.

First warning:

When I try to add the CONFIG_DISABLE_FLASH_PATCH flag to my prj.conf file as stated in this post (post2), it throws that the NCS_SAMPLE_MCUMGR_BT_OTA_DFU has the value "n":

When I try to add the BOOTLOADER_MCUBOOT to my prj.conf it suddenly activates the old build process with child and parent image functionality. 

What is correct approach here?

The second thing is that I want to add these flags to the mcuboot, but with sysbuid it does not recognise them: 

The error:

How do I pass the correct the flags to mcuboot.conf?

Thanks for the help!!!

  • Hi Aljosa, 
    Could you show the prj.conf you have ? 
    Have you make sure you have 

    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    In your prj.conf ?
    If you want to build with sysbuild, please add the mcuboot.conf into sysbuild folder under your application folder. Similar to child_image with the older build system. 
  • Hi Hung,

    ofc! Here is the prj.conf:

    ## Enable logger
    CONFIG_LOG=y
    
    ## Remove banners
    CONFIG_BOOT_BANNER=n
    CONFIG_NCS_BOOT_BANNER=n
    
    # Floating Point Unit
    CONFIG_FPU=y
    
    ## Button and LED library
    CONFIG_DK_LIBRARY=y
    
    ## CPU temperature
    CONFIG_SENSOR=y
    CONFIG_ADC=y
    
    ## Increase stack and heap size for the main thread and System Workqueue
    # CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_MAIN_STACK_SIZE=2048
    
    ## Extend the heap for the communication and FIFO
    CONFIG_HEAP_MEM_POOL_SIZE=4096 
    
    ## Include the Bluetooth LE stack in your project
    CONFIG_BT=y
    
    
    ## In GAP Layer take the Peripheral role: if not set you can get the error EIO (-5)
    CONFIG_BT_PERIPHERAL=y
    
    ## Configure the appereance when it is advertising
    CONFIG_BT_DEVICE_APPEARANCE=833
    
    ## Only one pairing allowed
    CONFIG_BT_MAX_PAIRED=1
    
    ## increase the BT RX stack 
    CONFIG_BT_RX_STACK_SIZE=2048
    
    ## Disable HCI Core log and HCI driver log
    CONFIG_BT_HCI_CORE_LOG_LEVEL_OFF=y
    
    ## softdevice controller revision 
    CONFIG_BT_HCI_DRIVER_LOG_LEVEL_OFF=y
    
    ## Update Data Length and MTU
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    #CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_L2CAP_TX_MTU=498
    
    
    ## Define the service to use Nordic UART Service (NUS)
    CONFIG_BT_NUS=y
    # CONFIG_BT_NUS_AUTHEN=n
    CONFIG_BT_NUS_SECURITY_ENABLED=n
    
    
    ## Enable FDU/FOTA over BLE
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

    Have you make sure you have 

    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    In your prj.conf ?

    The CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU is set in prj.conf and the CONFIG_BOOTLOADER_MCUBOOT is set in sysbuild.conf. I found out that this is how it should be set, link. The sysbuild.conf:


    ## enable MCUBOOT
    SB_CONFIG_BOOTLOADER_MCUBOOT=y
    If you want to build with sysbuild, please add the mcuboot.conf into sysbuild folder under your application folder. Similar to child_image with the older build system. 

    I also added the folder and the mcuboot.conf. Here is my folder structure:

    .
    ├── boards
    │   └── nrf52840dk_nrf52840.overlay
    ├── src
    ├── sysbuild
    │   └── mcuboot.conf
    ├── vault
    ├── Kconfig
    ├── pm_static.yml
    ├── prj.conf
    └── sysbuild.conf

  • Hi Aljosa, 

    Could you try the following project. It seems to build fine for me: 
    5367.peripheral_lbs_smp.zip

  • Hi Hung,

    Thanks, the warning is gone. The solution is to add these two symbols to mcuboot.conf:

    ## Note that disabling flash patching also disables breakpoints.
    CONFIG_DISABLE_FLASH_PATCH=y
    CONFIG_REBOOT=y
    If I could read properly, it would be easy to fix. On the Nordic site, and also on other Zephyr sites, it is written what is expected:

    https://docs.nordicsemi.com/bundle/ncs-1.8.0/page/kconfig/CONFIG_DISABLE_FLASH_PATCH.html 
    "expects REBOOT"

    Thank you for the help!!!
Related