Hello, I am test DFU USB function with my Thingy53. So far, I have been able to add DFU USB support from my application but not from the MCUboot. I am using the recommended AuTerm (v0.35a) to upload and read images. I can successfully upload the "signed_by_mcuboot_and_b0_ipc_radio.bin" file with the Test option, and this could be confirmed by reading images again as shown in the figure. But from the terminal output, I can see an error and two inf log outputs as shown:
[00:07:32.896,820] <inf> mcuboot_util: Image index: 0, Swap type: test [00:07:32.897,888] <inf> mcuboot_util: Image index: 1, Swap type: none [00:07:32.897,918] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2
I found a similar issue about this error code here (https://devzone.nordicsemi.com/f/nordic-q-a/108054/flash-area-error-while-doing-dfu-using-nrf-connect), and my conclusion from this post is that this error should not affect the DFU process.
But after I issue a reset command, what I should expect is that the two images swapped. But what happens is: 1) This time I only have one image in slot 0, there is no slot 1 anymore. 2) the log information in the terminal change to:
[00:00:16.194,580] <inf> mcuboot_util: Image index: 0, Swap type: none [00:00:16.195,220] <inf> mcuboot_util: Image index: 1, Swap type: none [00:00:16.195,251] <err> mcumgr_img_grp: Failed to open flash area ID 1: -2, which suggests both images are not swapable I assume? By checking the hash number of the image in slot 0 after reset, I can confirm it is the same image in slot 0 before I issue a reset command. So what happened is, after I issued a reset, the image in slot 1 just disappered while image in slot 0 is active. I attached my prj.conf file here:
CONFIG_GPIO=y #Enable I2C CONFIG_I2C=y # Enable SPI CONFIG_SPI=y # Disable TFM CONFIG_TFM_SECURE_UART=n CONFIG_TFM_LOG_LEVEL_SILENCE=y CONFIG_LOG=y CONFIG_USE_SEGGER_RTT=y CONFIG_LOG_BACKEND_RTT=y CONFIG_LOG_BACKEND_UART=y CONFIG_UART_RTT=y CONFIG_RTT_CONSOLE=y CONFIG_STDOUT_CONSOLE=y CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096 CONFIG_LOG_BUFFER_SIZE=8192 # Enable Bluetooth LE CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="thingy53" CONFIG_BT_BROADCASTER=y CONFIG_BT_OBSERVER=y # Increase stack size for the main thread and System Workqueue CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_MAIN_STACK_SIZE=10240 # Enale floating point unit for float point calculation CONFIG_FPU=y CONFIG_CBPRINTF_FP_SUPPORT=y # Enable debugging CONFIG_DEBUG_THREAD_INFO=y CONFIG_DEBUG_OPTIMIZATIONS=y # Enable multithread CONFIG_MULTITHREADING=y CONFIG_SENSOR=y CONFIG_PWM=y CONFIG_ADC=y CONFIG_VOLTAGE_DIVIDER=y CONFIG_NRFX_SAADC=y # Enable USB CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="thingy53" CONFIG_USB_DEVICE_PID=0x0001 CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y # STEP 5.2 - Enable mcumgr DFU in application # Enable MCUMGR CONFIG_MCUMGR=y # Enable MCUMGR management for both OS and Images CONFIG_MCUMGR_GRP_OS=y CONFIG_MCUMGR_GRP_IMG=y # Configure MCUMGR transport to UART CONFIG_MCUMGR_TRANSPORT_UART=y # Dependencies # Configure dependencies for CONFIG_MCUMGR CONFIG_NET_BUF=y CONFIG_ZCBOR=y CONFIG_CRC=y # Configure dependencies for CONFIG_MCUMGR_GRP_IMG CONFIG_FLASH=y CONFIG_IMG_MANAGER=y # Configure dependencies for CONFIG_IMG_MANAGER CONFIG_STREAM_FLASH=y CONFIG_FLASH_MAP=y # Configure dependencies for CONFIG_MCUMGR_TRANSPORT_UART CONFIG_BASE64=y
I am using nrf connect sdk v2.7.0 and toolchain v2.7.0