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

Cannot program nRF52840DK by copying hex file

I am not able to program the nRF52840DK by copying over the .hex file generated by my project to the JLINK drive. However I am able to successfully program using Segger directly from within the IDE. 

Do I need to enable something in the code or the tool in order to create a .hex file that will program the nRF52840 using the copy method.

Parents Reply Children
  • Hi - I'm not clear how to use the .hex file attached. Maybe I can illustrate with an example. If I go to examples\ble_peripheral\ble_app_blinky\hex and copy ble_app_blinky_pca10056_s140.hex (pre-compiled hex) that to the JLINK drive, the DK gets programmed and the one LED lights. If I open the project and build the hex using Segger and program from within the IDE it also works fine. However if I copy the generated hex file from the Segger project to the JLINK drive - located in examples\ble_peripheral\ble_app_blinky\pca10056\s140\ses\Output\Release\Exe - the LED remains off and the DK does not appear to program. Is there something in the configuration which enables the generated hex file to program the DK via USB using file copy?

  • Hi, 

    Please let me correct the solution. 

    In the BLE Blinky Application, there is a statement:

    Important: Before you run this example, make sure to program the SoftDevice.

     

    You need to load additional file for <nRF5_SDK>\components\softdevice\s140\hex\s140_nrf52_6.1.1_softdevice.hex

    This will flash the SoftDevice, and then the application is flashed afterward. 

    -Amanda

  • Hi - I don't believe this is the solution. This is because the project has the file included already and it is not working. In addition I believe the SoftDevice is the BLE stack and not related to flashing the device using USB copy. Here is another example not even using BLE - Peripheral/blinky has two projects - blank and mbr. blank works if the generated hex is copied to JLINK. mbr does not work. Both work when flashed directing from within Segger. There are project/build related differences in the projects but so far I cannot identify what is causing one to work and not the other.

  • Hi, 

    You are missing the MBR hex which can be found in components\softdevice\mbr\nrf52840\hex

    ravinp said:
    Both work when flashed directing from within Segger.

    Segger will flash the MBR hex for you.

    When you drag-drop-program the application hex file, the MBR/Softdevice will not be flashed. 

    In the SES examples, segger flashes the MBR/SoftDevice with the "load additional file "

    The blank project does not use the MBR, and the flash offset is 0. The MBR project the flash offset is 0x1000 to make room for the MBR (it's located from 0x00 to 0x1000 in flash).

     You can install the nRF Connect Programmer app to make sure all the files are included as the application overview.

     

     -Amanda

  • OK I now understand what is happening. Not sure if this is the correct way but for now I'm able to create a file that is flashed using USB copy by programming the DK using Segger and using nRF connect to read back and create a hex file from that. That file can be used to flash the DK using copy. 

Related