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

Bootloader update OTA not working (Application OTA is working)

Hello,

I am tring to do a Bootloader update OTA using the bootlader DFU Dual Bank. Application update OTA is working fine while it is not the case for Bootloader update OTA.

For Bootloader update, I have tried with a Zip file and .bin + .dat files on NRFConnect (Android). In both scenarios, I can see that the file was successfully transferred to the nrf52. However the old bootloader does not get replaced with the new one. I have a led on the boards that tells me which bootloader is active. The leds shows the old boatloader running even that the transfer of the files was successful

SDK Version: 11 Chip: NRF52 softdevice: s132 2.0.0 The files were generated with nrfutil.exe

Application OTA is working perfectly. I just need to replace the bootloader OTA to support the Watchdog.

Any idea why the Bootlader update OTA is not working? and why i am not receiving any error message?

Thank you, Karim

  • Hi Karim,

    You need to make sure the DFU process is successful. A sniffer trace may help here.

    Secondly, you may need to modify the bootloader to allow debugging (or you can add UART trace) and check why the bootloader is not replaced.

    Do you have any modification on the bootloader ?

  • Hi Hung, Thanks for your reply. I may have found the reason of this behavior.

    When flashing the chip and in order to flash only one single code that contains the bootloader+ SD + App, and following some other comments found in the forum I have applied the following modifications:

    bootloader_settings.c:

    • removed this line - uint8_t m_boot_settings[CODE_PAGE_SIZE] attribute ((section(".bootloaderSettings")));

    • added this line - attribute ((section(".bootloaderSettings"))) volatile uint8_t m_boot_settings[CODE_PAGE_SIZE] = {BANK_VALID_APP};

    Removed this from the ld file: / Place the bootloader settings page in flash. / .bootloaderSettings(NOLOAD) : { } > BOOTLOADER_SETTINGS

    Is there a way to update this bootloader either OTA or through SD card? Flashing the bootloader with a programmer is not possible anymore. Thanks

  • What you described may not explain why the bootloader update is not performed. I would suggest to test with a development kit (or your own board) not with the product that you can't flash with the programmer.

    Just to find the root cause.

    So you now have watchdog timer in your application code and you want to keep feeding it when you are in bootloader ? The last solution is to let the watchdog trigger the reset before you switch to bootloader (in stead of branching directly, let the watchdog reset and the bootloader will enter bootloader mode after checking the GPREGRET flag).

  • I am currently testing on my own board. I do have few products with the modified bootloader that I would like to update, once I have the right bootloader

    1. I have managed to have a bootloader that handle an App with watchdog -> the issue here that I cannot update the bootloader in product currently having previous Bootlodder. Transfer OTA finishes successfully but it seems like the bootloader doesn't get swapped with the new one. I verified this with a led

    2. I tried your last solution in order to allow App update OTA with a bootloder not supporting Watchdog. What I did is before calling bootloader_util_reset() I added an infinite look and wait for the watchdog to fire a reset. in NRFconnect it keep opening the image file but then it restarts

    I think the best thing is to find a way to update directly the bootloader (option 1) in order to have all the products with the same bootloader

  • I just would like to add the following information to my last comment: The products where I want to do a bootloader Update OTA doesn't have yet the Watchdog implemented in its app. So the issue here is a simple uploading of the bootloader OTA which is not working (it has Nothing to do with the watchdog). The Watchdog is simply a feature that I am planning to integrate in the new bootloader to support.

Related