Hello,
Recently, my team has been struggling with an issue regarding a nRF5340 device that's encapsulated and inaccessible to be flashed with a JTAG connection. Our normal use case is:
1. Connect to the device via the DeviceManager iOS app or equivalent Android app
2. Select the "image" option
3. Select the OTA package.zip
4. Click start and "Confirm only"
This has worked for us up until this point, and we've used this process for nearly a year now. However, we ran into an issue with one of our devices that's fully closed off where the OTA bugged midway through downloading and the app reported an error of "No free slot". My understanding is this:
There is enough space for two builds on the device, each made up of two images, one for the Bluetooth core and one for the main core, and the primary build slot is the firmware that the device is running, and the secondary build slot is for OTAing images. When an image is successfully downloaded into the secondary slot, the primary slot will switch over to the image in the secondary slot and clear the secondary slot, which will allocate space for future OTA images to be placed into the secondary slot.
However, I believe what has occurred is that the OTA process bugged during the uploading stage of the image to the device, and this has left the secondary build slot in a "stuck" state where it cannot accept any new OTA images since it's full with an incomplete one. Thus, the "No free slot" error.
To solve this, my approach would be to connect to the device over Bluetooth and tell it to clear the secondary build slot. This is much easier said than done though. To do this, I tried to communicate with mcuMGR terminal commands, but through many rabbit holes, I found that OTAing is not available over Windows and therefore there's not much support for how to communicate via mcuMGR to the device to get it to clear its secondary build slot.
My question, therefore, is: how can we clear the secondary build slot of the device to solve this "No free slot" error via Bluetooth? We cannot open or unencapsulate the device.
Thanks!