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 with nRF5340 DK.
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 applications can be built with a FOTA configuration that includes the required features and applications to perform firmware upgrades over Bluetooth LE.
The FOTA configuration requires that an external flash be available and that the required DTS overlay files use the external flash shield specified in the Requirements for FOTA above. With the external flash connected, it is possible to upgrade both the application core and the network core at the same time.
See multi-image DFU for more information about the FOTA process on the nRF5340 SoC.
Caution
Using the single-image upgrade strategy carries risk of the device being in a state where the application core firmware and the 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.
Caution
The application is provided with a memory partition configuration in pm_static_fota.yml
, which is required to perform FOTA using an external flash.
The partition configuration is an example that can be changed between versions, and can be incompatible with existing devices.
For this reason, always create a partition configuration that suits your application.
See Partition Manager for more information on how to create a partition configuration.
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 with nRF5340 DK (you can skip the configuration steps).