nRF9160 firmware upgrade process no longer works

I implemented firmware update over LTE Cat-M and Ethernet last year by modifying the `fota_download` and the `download_client` examples into my own slightly modified version, which has functions that choose ethernet or LTE depending on what's available for the download.

While preparing the firmware release for the production units I decided to test the firmware update and found it no longer works.

I've implemented the code using the nRF Connect SDK v2.2.2, which initially worked last year when tested.

So far, from my testing, I can tell it is correctly downloading the firmware image from the client's server. However, it doesn't seem to apply the firmware update after downloading it, even when using `dfu_target_schedule_update(0)` or `boot_request_upgrade(BOOT_UPGRADE_PERMANENT)`. From additional debug information, I can tell that it is writing the MCU image type as 0x03, which should be permanent.

Development software: JLinkRTT Viewer, nRF Connect SDK v2.2.2

Computer platform: Ubuntu 24.04

Note that I am using the MCU boot key, which is publically known at the moment, not a custom key for signing.

Attached is a version of the firmware with most things removed except for the modem and firmware update code.

0564.controller-ng.tgz

  • I'm glad to hear you found the problem, but it is unfortunate that you had to spend a lot of time debugging it. I don't recall encountering this problem before. The 'child_image/mcuboot/boards/nrf9160dk_nrf9160.overlay' should always be applied to the mcuboot child-image build if you build target is 'nrf9160dk_nrf9160_ns' (Note: the mcuboot child image will be built for the secure processing environment so the nrf9160dk_nrf9160_ns.overlay will not be used).

    Have you tried building the project from the command line to see if you experience the same problem? You can check the generated zephyr.dts file in build/mcuboot/zephyr to see if the overlay was applied or not. Also, is your nRF Connect VS code extension up to date?

  • It seems that doing that doesn't really resolve the issue. What I ended up doing was deleting the build directory from VS Code and then recreating the build for the target board.

    If the build fails, running the pristine a few times will get it to build correctly.

  • I hadn't tried building it from the command line. I believe the issue is related to a specific version of West; maybe. 

    It seemed to be failing to pick up the `nrf9160dk_nrf9160.overlay` file when I was building for `nrf9160dk_nrf9160_ns.overlay`. 

    I'm considering this issue solved for now, as I can build it correctly on a new Ubuntu 24.04 install with the fully updated nRF Connect SDK. However, there still seem to be edge cases that result in the build failing to include the overlay.

  • Thank you for the update. If you do encounter this again, please check if the west build command issued by VS code is the same as when it worked. You can see the build command if you have the vs code terminal view open while building your project.

Related