MCU BOOT and DFU not working

I am developing with nRF2.3.0 on Windows 11.  We have a custom board nRF52832-QFAA.  The application is quite large and works well when flashed to the board.  We need to add OTA DFU over BLE capability and I have yet to make it work.

1) In a debug build the application boots properly and works as expected.  Since the application is large, I have to turn off all debug to get it to build without overrunning FLASH and RAM.  I have gotten it to this point.  

2) When I flash this image on the board with MCUMGR enabled, nothing happens.  The application doesn't wok at all, the board isn't in any of the states i expect it to be in.  This is difficult because i cant have any debugging enabled.  I should be able to see an LED come on after boot but that doesn't even happen.  Any logging I would be doing comes over SEGGER_RTT but as i said it is disabled.

This is my conf file:

#required for debugging this chipset
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

#MCU Manager
CONFIG_MCUMGR=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_STAT_MGMT=y

#memory settings
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
CONFIG_MAIN_STACK_SIZE=2048

#Thread settings
CONFIG_THREAD_NAME=y
CONFIG_THREAD_MONITOR=y

#Enable statistics (MCU ADDED)
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

#setup the flash config
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_SOC_FLASH_NRF=y

# Support for taskstat command
CONFIG_OS_MGMT_TASKSTAT=y

#setup the bluetooth config
CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y  #required for FOTA
CONFIG_BT_SMP=y
CONFIG_BT_GATT_CLIENT=y

#Bluetooth settings
CONFIG_BT_BUF_ACL_RX_SIZE=256
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255

CONFIG_BT_L2CAP_TX_MTU=252
#CONFIG_MCUMGR_SMP_BT=y
#CONFIG_MCUMGR_SMP_BT_AUTHEN=n
#CONFIG_SHELL=y
#CONFIG_MCUMGR_SMP_SHELL=y

#debug settings
#CONFIG_BT_DEBUG_LOG=y
#CONFIG_CONSOLE=y
#CONFIG_LOG_BACKEND_RTT=y
#CONFIG_LOG_DEFAULT_LEVEL=4
#CONFIG_USE_SEGGER_RTT=y
#CONFIG_RTT_CONSOLE=y
#CONFIG_PRINTK=y
#CONFIG_LOG_PRINTK=y
#CONFIG_CBPRINTF_FP_SUPPORT=y
#CONFIG_LOG=y
#CONFIG_LOG_MODE_IMMEDIATE=y

#GPIO and ADC settings
CONFIG_GPIO=y
CONFIG_ADC=y
CONFIG_NRFX_SAADC=y
CONFIG_BT_DEVICE_NAME="Device-name"

This is the final output from the compile:

Memory region Used Size Region Size %age Used
FLASH: 229732 B 237056 B 96.91%
RAM: 62984 B 64 KB 96.11%
IDT_LIST: 0 GB 2 KB 0.00%
[255/263] Generating ../../zephyr/app_signed.hex
sign the payload
[256/263] Generating ../../zephyr/app_update.bin
sign the payload
[257/263] Generating ../../zephyr/app_test_update.hex
sign the payload
[259/263] Generating ../../zephyr/app_moved_test_update.hex
[261/263] No install step for 'mcuboot_subimage'
[262/263] Completed 'mcuboot_subimage'
[263/263] Generating zephyr/merged.hex

I have flashed merged.hex to the board.

I am at a loss as to what to do next. nothing I have found online as helped.  The first priority is to have MCUBOOT enabled and have the application run as usual.

Thanks

Parents
  • Hello,
    You can resize the MCUBoot partition by adjusting the CONFIG_PM_PARTITION_SIZE_MCUBOOT setting in your MCUBoot config file. For doing this create a child image folder inside the Application and enable the configuration. See the memory layout inside the Partition Manager. Refer this thread.

    Follow this thread and go through the steps mentioned for memory optimization.

    Kind Regards,

    Abhijith

  • Ok I will work on that.  However what does this have to do with the application running?  It compiles, it uses most of the FLASH and RAM but it loads on the board.  It just isn't running.  Could you provide a little explanation what resizing will do to help my problem?  I am reading through the provided information now and will re-post when i have another question.  It doesn't seem like ill be able to increase the partition size though because from what i understand I need equal slot 0 and slot 1 sized areas and I don't have that space to increase.

    Additionally I have tried making the peripheral_hr application and loading on the nrf52_dk board and adding MCUBOOT to that as well.  While that application runs, it wont update.  The Nordic DFU Application connects, and fails with an error saying it cant make an update from the dfu_application.zip file.

Reply
  • Ok I will work on that.  However what does this have to do with the application running?  It compiles, it uses most of the FLASH and RAM but it loads on the board.  It just isn't running.  Could you provide a little explanation what resizing will do to help my problem?  I am reading through the provided information now and will re-post when i have another question.  It doesn't seem like ill be able to increase the partition size though because from what i understand I need equal slot 0 and slot 1 sized areas and I don't have that space to increase.

    Additionally I have tried making the peripheral_hr application and loading on the nrf52_dk board and adding MCUBOOT to that as well.  While that application runs, it wont update.  The Nordic DFU Application connects, and fails with an error saying it cant make an update from the dfu_application.zip file.

Children
No Data
Related