FOTA to an encapsulated Bluetooth device that is having "No free slot" error

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!

  • Thanks for the help Edvin! That's definitely something I'll look into, I think we're confirming images on the app side, but if we can do it in our code, we definitely will.

    How do we reboot our device without erasing the second image? Could you elaborate?

    Thanks!

  • You can reboot as I described in my initial reply. 

    Rebooting will not erase the second image in itself. But it will revert back to the old image, if the new one was not confirmed. Then you can choose whether you want to test the new image again, or if you want to delete it and upload another. 

    I believe the issue was that you were running an unconfirmed image, and hence, it couldn't delete the only confirmed image that it had (which was currently placed in slot 1 (the running image is always in slot 0, even though it is not confirmed). 

    So if you were to reboot, it would boot up the old confirmed image (after swapping it back to slot 0), and slot 1 would still contain the unconfirmed image, until you either manually erase it using mcumgr, or until you try to upload a new image.

    BR,
    Edvin

Related