Hi guys - need your help on this!
nrf5340 based board with no external flash (so using nrf5340 on chip flash only)
using SDK v2.3.0 on MacOS
testing DFU update using nrf Connect Mobile on iOS v2.6.7, Build 34
(as well as testing in our own iOS app)
The problem:
DFU OTA over BLE update of the Application Image using "app_update.bin" has worked for a long time & we have no problems with it. This works perfectly BOTH in nrf Connect for iOS well as in our own iOS application. Has worked reliably for more than 1 year now.
However, occasionally we need to do a "simultaneous" multi-image update of BOTH the Application & Network Cores.
We can't get this to work & have tried many different configuration options. We always get the error "'Remote Error: In Value(3)" in nrfConnect Mobile on iOS (as well as in our own iOS application which includes DFU updates). Have tried it numerous times with AND without the "Erase App Settings" switch set on (or off). The setting of the "Erase App Settings" seems to make no difference on the error returned.
I have read/studied the following:
and
https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/nrf5340
as well as read all the other related cases on devzone. But somehow I/we can't get it to work in our own firmware builds! So I must be missing or overlooked something fundamental!
Below are some screenshots from nrf Connect Mobile for iOS showing "success" when using "app_update_bin" but failure when using "DFU_application.zip".
I have also included the log from nrf Connect for iOS when it fails with the multi-image update.
Below are copies of our prj.conf, hci_rpmsg.conf & mcuboot.conf
# # Copyright (c) 2021 WearSense LLC # # WEARSENSE FIRMWARE REVISION TO BE UPDATED HERE!!! CONFIG_BT_DIS_FW_REV_STR="09.21" # CONFIG_WATCHDOG=y CONFIG_REBOOT=y # Activate Power Management (reduce power requirements # see: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/optimizing-power-on-nrf53-designs CONFIG_PM=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_BOARD_ENABLE_DCDC_APP=y CONFIG_BOARD_ENABLE_DCDC_NET=y CONFIG_BOARD_ENABLE_DCDC_HV=y CONFIG_SERIAL=n # Errata 160 included in v2.3.0 - ensure System Clock is enabled CONFIG_SYS_CLOCK_EXISTS=y # to enable RTT logging (for debugging) - change next 2 lines to "=y" # NOTE: set both "=n" for optimal power optimization (so disable for "production" or battery life/power monitor tests) CONFIG_LOG=n CONFIG_USE_SEGGER_RTT=n CONFIG_RESET_ON_FATAL_ERROR=y # not sure this works for non "Nordic DK" boards!? CONFIG_ASSERT=n # crashes i2c init when turned on (=y) with RTT logging - need to investigate...!? CONFIG_LOG_DEFAULT_LEVEL=3 # CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048 # Debugging configuration # CONFIG_THREAD_NAME=y # CONFIG_THREAD_ANALYZER=y # CONFIG_THREAD_ANALYZER_AUTO=y # CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y # CONFIG_THREAD_ANALYZER_USE_PRINTK=y # CONFIG_ASSERT_VERBOSE=y # CONFIG_ASSERT_NO_COND_INFO=n # CONFIG_ASSERT_NO_MSG_INFO=n # disable all things related to uarts, usb & console (for max power savings) - CONFIG_SERIAL=n already set above CONFIG_CONSOLE=n # CONFIG_STDOUT_CONSOLE=n # CONFIG_USB_DEVICE_STACK=m # CONFIG_TFM_LOG_LEVEL_SILENCE=y # CONFIG_LOG_BACKEND_UART # set stack & heap sizes. CONFIG_HEAP_MEM_POOL_SIZE=8192 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_BT_RX_STACK_SIZE=4096 # Disable the DK (nordic dev Boards) LED and Buttons library for WearSense boards CONFIG_DK_LIBRARY=n # required for generating random number for suffix of original BLE NAME set for device. CONFIG_ENTROPY_GENERATOR=y CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR=y # configure Settimgs to be stored in NVS Flash on nrf5340 SoC CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_SETTINGS_NVS=y CONFIG_SETTINGS_RUNTIME=y # BLE Settings CONFIG_BT=y CONFIG_BT_SETTINGS=n # for now we take care of our own BLE settings. CONFIG_BT_CENTRAL=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="WearSense Sensor" # Name is re-defined & replaced at runtime CONFIG_BT_DEVICE_NAME_DYNAMIC=y CONFIG_BT_MAX_CONN=1 CONFIG_BT_MAX_PAIRED=1 # appearance 1344 = "Generic Sensor" # (see: https://specificationrefs.bluetooth.com/assigned-values/Appearance%20Values.pdf ) CONFIG_BT_DEVICE_APPEARANCE=1344 # configure BLE "Device Information Service" (BT_DIS) characteristics. CONFIG_BT_DIS=y CONFIG_BT_DIS_MODEL="WearSense LS2" CONFIG_BT_DIS_MANUF="wear-sense.com" CONFIG_BT_DIS_FW_REV=y CONFIG_BT_DIS_SETTINGS=y # allows following values to be assigned at runtime CONFIG_BT_DIS_SERIAL_NUMBER=y # assigned at runtime in code CONFIG_BT_DIS_HW_REV=y # assigned at runtime in code CONFIG_BT_DIS_SW_REV=n # not required for WearSense app. CONFIG_BT_DIS_PNP=n # not required for WearSense app. CONFIG_BT_NUS=y # Enable the NUS service (in advertising) CONFIG_BT_BAS=y # Enable the Battery Level service (in advertising) CONFIG_BT_USER_DATA_LEN_UPDATE=y #This is the maximum data length with Nordic Softdevice controller CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 #These buffers are needed for the data length max. CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_ACL_RX_SIZE=251 #This is the maximum MTU size with Nordic Softdevice controller CONFIG_BT_L2CAP_TX_MTU=247 CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=y CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y # set BLE 'connect parameters' for lowest power consumption # so lower data transfer speed but low power when connected but not sending data... # 36 = 30ms, 48 = 60ms # 30 = able to 'miss' max of 30 intervals of 60ms each to keep BLE connection alive. # 600 = 6000 ms - max allowed by Apple (& probably others) CONFIG_BT_PERIPHERAL_PREF_MIN_INT=36 CONFIG_BT_PERIPHERAL_PREF_MAX_INT=48 CONFIG_BT_PERIPHERAL_PREF_LATENCY=30 CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=600 CONFIG_NEWLIB_LIBC=y CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y CONFIG_NEWLIB_LIBC_FLOAT_SCANF=y # Enable mcumgr (used for reset over BLE and OTA firmware updates). CONFIG_MCUMGR=y # Ensure an MCUboot-compatible binary is generated. CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_MCUMGR_SMP_BT=y CONFIG_MCUMGR_SMP_BT_AUTHEN=n CONFIG_DFU_MULTI_IMAGE=y CONFIG_DFU_MULTI_IMAGE_MAX_IMAGE_COUNT=2 CONFIG_NRF53_UPGRADE_NETWORK_CORE=y CONFIG_MCUBOOT_IMG_MANAGER=y # Enable core DFU/OTA features. CONFIG_MCUMGR_CMD_IMG_MGMT=y CONFIG_MCUMGR_CMD_OS_MGMT=y CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y # set BLE 'Connect Interval' Parameters for SMP (used for OTA) to fastest possible transfer speed.. CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL=y CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL_MIN_INT=12 CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL_MAX_INT=12 CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL_LATENCY=0 CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL_TIMEOUT=200 CONFIG_MCUMGR_SMP_WORKQUEUE_STACK_SIZE=8192 # Enable the SAADC ADC support CONFIG_ADC=y CONFIG_ADC_ASYNC=y CONFIG_ADC_NRFX_SAADC=y CONFIG_FPU=y # I2C required to read Pressure Sensor & Accelerometer CONFIG_I2C=y
# # Copyright (c) 2021 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # # required for max power savings! CONFIG_LOG=n #changed CONFIG_SERIAL=n CONFIG_CONSOLE=n CONFIG_IPC_SERVICE=y # CONFIG_IPC_SERVICE_BACKEND_RPMSG=y CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=4096 CONFIG_BT_RX_STACK_SIZE=4096 # BLE Settings CONFIG_BT=y # CONFIG_BT_SETTINGS=n # for now we take care of our own BLE settings (no pairing, etc). CONFIG_BT_CENTRAL=n CONFIG_BT_PERIPHERAL=y CONFIG_BT_HCI=y CONFIG_BT_HCI_RAW=y CONFIG_BT_MAX_CONN=2 CONFIG_BT_CTLR_ASSERT_HANDLER=n # would like to set this to "y" & handle in application code. Checking with devzone! #For data length update CONFIG_BT_USER_DATA_LEN_UPDATE=y #This is the maximum data length with Nordic Softdevice controller CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 #These buffers are needed for the data length max. CONFIG_BT_BUF_ACL_TX_SIZE=251 CONFIG_BT_BUF_ACL_RX_SIZE=251 #This is the maximum MTU size with Nordic Softdevice controller CONFIG_BT_L2CAP_TX_MTU=247
# CONFIG_MCUBOOT_LOG_LEVEL_WRN=y CONFIG_SERIAL=n CONFIG_CONSOLE=n
Would really appreciate if you guys could have a quick look at this & let me know what I am missing!
Thanking you in anticipation
Best Regards
Gerard