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

Flashing bootloader and application via J-Link

Hello. I want to make flashing of devices for production faster. So I want to write application together with bootloader via J-Link simultaneously and not via OTA DFU. I'm using S110 v6 and dual bank BLE DFU from SDK 5.1 example. I know that after flashing bootloader and application I just need to compute CRC16 of the DFU bank 0 and write this value to the bootloader settings in the flash, but maybe someone already has a solution to this problem?

  • Thanks Nikita. I'm using the following with no luck (app does not boot):

    nrfjprog --eraseall nrfjprog --programs %SOFTDEVICE% --verify nrfjprog --program %APP% %BOOTLOADER% --verify nrfjprog --reset

  • Does the bootloader working properly? If the bootloader working properly and updates your app just fine but app doesn't start then it may be that UICR are not programmed. If you write your UICR separately from bootloader hex then you need to add additional nrfjprog write to the UICR.

  • Bootloader works perfectly after the aforementioned flash routine: the app can be flashed via the UART bootloader and it boots correctly. The line that is failing is: if (p_bootloader_settings->bank_0 == BANK_VALID_APP) ... which Is evaluating to FALSE even though I have set BANK_VALID_APP using John's method. "bank_0_crc" is also NOT zero. So my conclusion is that "p_bootloader_settings" doesn't have contain the correct data in the first place - any ideas?

  • What exactly are your your actions?

    1. Flashing S110 + bootloader + app via J-Link It must all works fine at this point.
    2. You updating your app via bootloader (?) Now your bootloader works but your newly flashed app is not loading (?) Is it correct?
  • Correct. Flashing S110 + bootloader + app via J-Link works. However, the one problem is that the bootloader does not run the application. At this point, I can use the UART DFU to reflash the application and it then loads correctly (everything works!). The source of this problem seems to be that "p_bootloader_settings" does not have BANK_VALID_APP set and crc set to ZERO (so it is failing the bootloader valid check).

Related