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

buttonless app jlink dfu

I try create my own app based on buttonless app. I've tested dfu over the air it's ok. But for that I need to firmware bootloader (with security key) before. It's ok for production, but while I work on my app I need to firmware chip very many times and of course do it through jlink debugger much more convenient. With previous SDK versions I could do it, I just didn't load the bootloader into chip and it's ok, now I got error in log "no bootloader", if I load BL I can't load my app via Jlink. What's the best way of doing my thing?

Parents Reply Children
  • Thanks. I did the same way in prior sdk (12,13) and it's worked. Actually I thought we must to do it in any case (I mean merge settings app and bootloader hex file).

    But buttonless_dfu app in sdk 14 it's not work. I can programm device without changing after ota, but if I change code a little and try to programm, bootloader not start app and in nrf connect app I see DfuTarg.

  • @Stas: Note that you need to generate bootloader setting every time you modify the application. The reason is that there is a CRC check in the bootloader setting.

  • But it's not convenient do it each time while create app (because I probably need to do it some hundreds times). Could you give an advice how to create app in better way. Just remind I modify buttonless_dfu app in SDK 14. Now I need to update firmware (not in production) each time by OTA.

  • Yes you either can modify the bootloader in nrf_dfu_app_is_valid() function to ignore CRC check remove this: if (crc != s_dfu_settings.bank_0.image_crc)

    Or you can edit the bootloader setting and set the CRC to 0. Just do nrfutil settings display setting_file_name.hex to see the CRC and look for that in the hex file to modify it to 0, when CRC set to 0 the bootloader will skip CRC check.

  • sorry for long delay. After I commented part of code where we check crc ( if (crc != s_dfu_settings.bank_0.image_crc)), I can program app via Jlink. But I loose ability to do it wirelessly via smartphone. Now after flash bootloader I can see only led 2 on my nrf52dk and can't see now DfuTarg while scanning in nrfconnect. Is it ok? After I uncommented crc checking part of code, I can see both leds and DfuTarg advertises me.

    About change crc to 0. if I understood correct we need to change that in settings file generate based on our_app.hex file so in my case it's 0x82461E8A. I've found it in settings.hex. How I have to change it to 0? I tried just replase 82461E8A to 00000000. After that I was not able to merge it with bootoader.hex

Related