This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FOTA with Nordic Connect SDK (ncs) not working

I'm blocked trying to get an Nrf52 application developed under v1.3.0 SDK work with FOTA.

My application is working fine. FYI, its on custom hardware derived from nrf52832_mdk board definition, and the lbs sample.

Now to add FOTA capability. No buttons or display, so buttonless.

I followed the instructions from here, 

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_nrf52.html?highlight=fota#fota-upgrades

and I end up with an application that has the DFU characteristic advertised, and nrf connect for mobile and connects to, for DFU. I rebuild an application and try to upload it via NRF Connect, and after a short time of "validating app" on the screen, it reverts back with no error message.

Goggling suggests there is some bug with page alignment fixed mid last year. So I try to copy my application to SDK v1.4.2, and I get a raft of build errors, which cannot be navigated to easily in the IDE. Even the previously supported types like u8_t are no longer valid!

Does anyone have any suggestions? I've used buttonless FOTA on a product on the previous NRF5 SDK with no issues, I'd rather not abandon this mess and go back.

  • Hi Mike,

    Thank you. This is puzzling, to be honest. Would it be possible to provide your example that reproduce this on a DK, with instructions on how to reproduce? That way I can debug on my side as well. You can create a private ticket and refer to this one if you do not want to share the code in public.

    Mike Hibbett said:
    Can you provide me with an existing example of creating a FOTA build, based on the nrf52832? I presume this has been tested. I could then use that as the basis for working out my own settings.

    Regarding the question about an existing FOTA example that is present in the nRF Connect SDK. I understand you are using NCS 1.3.0, and I just verified that the example works there. You can use it like this:

    1. Navigate to zephyr\samples\subsys\mgmt\mcumgr\smp_svr\ (using NCS 1.3.0 in this case, but method is same for newer versions)
    2. Build with west build -b nrf52dk_nrf52832 . -- -DOVERLAY_CONFIG=overlay-bt.conf
    3. Program build/zephyr/merged.hex from the first build. This way you have MCUboot and the application which has smp_svr and bluetooth transport on it.
    4. (Open a UART PuTTY terminal to the nRF so that you can observe the log)
    5. Build the example again to get a different app binary (build time stamp is part of the app due to logging it)
    6. Copy build/zephyr/app_update.bin to your phone (call it something like first_app_update.bin to be able to distinguish it)
    7. Program the .bin from  via DFU (I use nRF Connect for iOS but nRF Connect for Android should do the same)
    8. Observe from logs that it works
    9. Go back to step 5 and to this again, observe that second DFU upgrade also works.

    Einar

  • That worked, with only a small modification!

    My modification was changing the board's Kconfig file, setting DCDC to "n", as my custom board does not have the external DCDC converter circuit, as I dont need it.

    My issue was that the smp_svr build instructions, on the link below, include a step (signing the image) that simply fails. So I never proceeded. It did not state that the failing step was not required.

    Great, thanks for that, I can now work from your build instructions to integrate FOTA into my existing application.

    Thanks,

    Mike

    developer.nordicsemi.com/.../README.html

  • Hi Mike,

    I am glad to hear it works. Regarding signing the smp_svr sample documentation does not take into account the work done by the partition manager script that is part of NCS which handles signing for you (using default key when nothing is specified), so it is not entirely accurate in the NCS context.

    Einar

  • Hi Mike,

       I am having issue on nrf52832 NCS FOTA . https://devzone.nordicsemi.com/f/nordic-q-a/72803/ncs-ota-dfu-failed-in-nrf52832/300422#300422

    I have the problem

    during OTA from android mobile process gets rejected. no changes happened 

    If possible can you share your working example code "LBS code" . so that it will be helpful.

Related