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

nRF52 app plus bootloader

We're working on getting our nRF52 app working with buttonless OTA updates and the bootloader. OTA works fine with the example bootloader, but when we extend our application to include the bootloader (as described here: infocenter.nordicsemi.com/index.jsp, the app or anything that we can tell never starts properly. It's as if the device is just sitting there.

I suspect our problem is with the packaging of the the hex file. There are a few posts about using mergehex to update the hex file with to apply proper bootloader settings. I've found a few different hex files to merge in various posts which should allow our app to start on power up or reset, but I believe they are specific to the nRF51. Don't know if that makes a difference, but given I've found at least two different ones, and neither works, makes me thinks this could be the problem.

Can anyone provide a proper hex file for the nRF52 dev kit that will allow us to add the bootloader to our app/hex file and have the app properly start on hard reset? Or is there a specific example app in a later version of the SDK that we haven't seen that has a buttonless OTA implemented and working for the nRF52?

We are using nRF52 SDK 0.9.2, with softdevice s132 1.0.0-3 alpha, on pca10040 version of the dev kit. Our app is based on the ble_app_hrs in the SDK. Keil uVision with various jlink tools.

Any help or pointers are appreciated.

Thanks Ed

  • So if you flash the application with DFU support together with the Bootloader and Softdevice, then neither the Bootloader or the application wills start?

  • Yes, that appears to be the case. Neither the debugger nor various printfs I've added show anything - I've see various posts on debugging this, but none have really worked for me.

    Here's my script:

    mergehex -m s132_nrf52_1.0.0-3.alpha_softdevice.hex appIn.hex app_valid_setting_apply.hex -o appOut.hex nrfjprog.exe --family NRF52 --eraseall nrfjprog.exe --family NRF52 --program appOut.hex nrfjprog.exe --family NRF52 --verify appOut.hex nrfjprog.exe --family NRF52 --reset

    After I run the script, I can see the app, softdevice, and bootloader at the proper addresses in nRFgo Studio.

    Ed

  • Could you upload the app_valid_setting_apply.hex? Does the device start in bootloader mode if you do not merge in the app_valid_setting_apply.hex?

  • Here's two I tried:

    :020000040003F7 :10FC00000100000000000000FE000000FFFFFFFFF9 :00000001FF

    :020000040003F7 :08FC00000100000000000000FB :00000001FF

    If I do not merge either hex file above, the device appears to be non-operable - I don't get anything on the console, nor can I see any dfu advertising, etc. So it really doesn't seem to matter if one of the above files are merged or not, device seems to be dead. Any suggestions are debugging further, troubleshooting, etc. are appreciated.

    Ed

  • Does the application run on the PCA10040 if you do not extend the application with DFU support?

    Looking at one of your previous comments:

    mergehex -m s132_nrf52_1.0.0-3.alpha_softdevice.hex appIn.hex app_valid_setting_apply.hex -o appOut.hex

    nrfjprog.exe --family NRF52 --eraseall

    nrfjprog.exe --family NRF52 --program appOut.hex

    nrfjprog.exe --family NRF52 --verify appOut.hex

    nrfjprog.exe --family NRF52 --reset

    In the first step(mergehex) it would appear that you're only merging the SoftDevice and the Application. Is the bootloader hex already merged with the application or softdevice?

Related