Configuring and testing FOTA upgrades for nRF5340 Audio applications
The nRF5340 Audio applications all support FOTA upgrades, and the application implementation is based on the procedure described in FOTA updates.
Requirements for FOTA
If the application is running on the nRF5340 Audio DK, you need an external flash shield to upgrade both the application and network core at the same time. See Requirements for external flash memory DFU in the nRF5340 Audio DK Hardware documentation for more information.
Configuring FOTA upgrades
The nRF5340 Audio application supports two strategies for upgrading the applications on the application and network core: single-image and multi-image.
You control which of the two strategies is used by setting the Kconfig CONFIG_AUDIO_DFU
to the appropriate setting.
Single-image upgrade - Uses the internal flash to upgrade either the application core or network core separately. You can select this method by setting
CONFIG_AUDIO_DFU
to1
.Multi-image upgrade - Uses external flash to upgrade both the application and network core at the same time. You can select this method by setting
CONFIG_AUDIO_DFU
to2
. See multi-image DFU for more information about the process.
Caution
Using the single-image upgrade strategy carries risk of the device being in a state where the application core firmware and network core firmware are no longer compatible, which can result in a bricked device. For devices where FOTA is the only DFU method available, multi-image upgrades are recommended to ensure compatibility between the cores. Make sure to evaluate the risks for your device when selecting the FOTA method.
Updating the SoftDevice
Both FOTA upgrade methods support updating the SoftDevice on the network core. However, the current default build options for the SoftDevice create a binary that is too large to run on the network core together with a bootloader. To reduce the size of the SoftDevice binary, you can disable unused features in the SoftDevice. See SoftDevice Controller documentation for more information.
Entering the DFU mode
The nRF Connect SDK uses SMP server and mcumgr as the DFU backend. The SMP server service is separated from CIS and BIS services, and is only advertised when the application is in the DFU mode. To enter the DFU mode, press BTN 4 on the nRF5340 Audio DK during startup.
To identify the devices before the DFU takes place, the DFU mode advertising names mention the device type directly.
The names follow the pattern in which the device role is inserted between the device name and the _DFU
suffix.
For example:
Gateway:
NRF5340_AUDIO_GW_DFU
Left Headset:
NRF5340_AUDIO_HL_DFU
Right Headset:
NRF5340_AUDIO_HR_DFU
The first part of these names is based on CONFIG_BT_DEVICE_NAME
.
Note
When performing DFU for the nRF5340 Audio applications, there will be one or more error prints related to opening flash area ID 1. This is due to restrictions in the DFU system, and the error print is expected. The DFU process should still complete successfully.
Testing FOTA upgrades
To test FOTA for the nRF5340 Audio application, ensure the application is in the DFU mode, and then follow the testing steps in the FOTA over Bluetooth Low Energy section of FOTA updates (you can skip the configuration steps).