This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Any flag to check the Bootloader is succesfully programmed ?

Hello all, I'm using nrf51822 xxac on my project, however, I sometimes got feedback from my customer and said the OTA is not work. My device can't turn to DFU mode for firmware update. So, as I connect it via the j-link and using nRFgo Studio, I found the partition of bootloader is gone, only Softdevice & Application sections remained. Thus, I'd like to know if there's any flag could be use to check the existence of bootloader code.

Furthermore, is it a way that I can save additional hex file somewhere and replace the original section if necessary ?

Thank you

  • Using the nrfjprog tool you can read out code sections from the nRF51 to a hex file. Next you can use some diff tool (WinMerge works great) to ensure that the content of the nRF51 is correct.

    By looking at the linker configuration to find the location of the hex files, and their size, you would be able to extract what should correspond to the files that are built from your projects.

    nrfjprog is a command line tool that should be installed alongside nRFgo Studio.

    You can also overwrite whatever is located in your device using nrfjprog.

  • You can read NRF_UICR->BOOTLOADERADDR to see if it has any valid address stored in it. Then you can read the address (that was previously read from NRF_UICR->BOOTLOADERADDR ) and check if that the partition has some other values other than the flash reset value (0xFFFFFFFF)

    use nrfjprog tool from command line tool

    C:\Users\user>nrfjprog --memrd 0x10001014 --n 4
    0x10001014: FFFFFFFF                              |....|
    

    The device I read from did not had a bootloader, above value confirms it. But if your device reads something else other than this reset value, then you have to use nrfjprog to read that address too just to confirm that the application did not delete the bootloader by accident. If the application deletes the bootloader by accident then it will not be reflected in the BOOTLOADERADDR register.

Related