FOTA Download Resume After Reboot: A Smooth Experience

Hello everyone, I wanted to share my recent experience with implementing FOTA (Firmware Over-The-Air) updates on my nRF9160 board. Initially, I faced a challenge where the FOTA download wouldn’t resume after a reboot, which was quite frustrating. However, after some thorough research and tweaking, I managed to resolve the issue, and I thought it would be helpful to document my journey here. The Problem: After setting up FOTA on my device using Nordic’s SDK3.1.0, I noticed that upon rebooting, the download process would start from scratch despite saving the progress. This was inconvenient, especially since I knew the functionality was possible with an older SDK version. The Solution: I discovered that the issue stemmed from how the URI hashes were handled after a reboot. The hashes, which are used to verify if the download is resuming from the same file, were reset upon reboot. This triggered the system to treat it as a new download, hence ignoring the saved progress. Configuring for Success: To fix this, I ensured that the necessary configurations were enabled in my project’s configuration file. Specifically, I made sure that CONFIG_STREAM_FLASH_PROGRESS=y was set. This configuration allows the progress to be saved and restored correctly after a reboot. The Outcome: After implementing these changes, the FOTA download now resumes seamlessly from where it left off, even after a reboot. This has significantly improved the reliability of my updates, and I no longer have to worry about starting over. Tips for Others: - Double-check your configuration settings to ensure all necessary progress-saving options are enabled. - If you’re using a scatter file, make sure there’s a partition allocated for storing the progress data. - Consider adding logging statements to track the download progress and verify that the saved data is correctly restored after a reboot. This experience taught me the importance of thorough configuration and the value of persistent debugging. I hope this helps anyone else facing similar issues with FOTA updates!