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

JLink Firmware for nrf52840DK Shows Board as nrf52DK

I am currently developing on the nrf52840DK (Rev 1.1.1) using the mbed os.

To debug on the board using OpenOCD it is necessary to flash the JLink firmware for the board. This leads to a problem with mbed os, as the board is now shown as "NRF52_DK" when calling "mbed detect". Resulting in the problem, that some code cannot be properly compiled by mbed os, as the nrf52840DK has some additional flags for features that are not available on the nrf52DK, such as the complete CryptoCell 310 support.

Best regards

Parents Reply Children
  • Could you verify me to the command? I currently have only a single dev board, and I do not want to brick it by accident.

    nrfjprog --family NRF52 --reset --program "J-Link OB-SAM3U128-V2-NordicSemi 170724.hex" # hex created from bin

  • You should not use nrfjprog to program the on-board-debugger.

    In order to switch out the debugger IF (reprogram the Atmel IC near the USB plug) to either MBED or JLINK, you should hold down the "IF BOOT/RESET" while you power on the nRF52-DK.

    At this point, a drive will enumerate with the label "BOOTLOADER".

    Drag and drop the wanted .bin file over to this drive, wait 10 seconds, then power cycle your board again.

     

    To use nrfjprog, you need the above sequence to be loaded with the J-Link OB*.bin file.

    Once the above sequence is performed, and the jlink.bin file is successfully loaded, you can use nrfjprog like this:

    nrfjprog --program path\to\hex\file.hex --sectorerase -f nrf52 --reset

    Note: The .hex file should be a compiled program for nrf52, as you're targeting the nRF52 now.

     

    Kind regards,

    Håkon

  • The problem is not the flashing per se, but 'mbed os' saying: "We compiled it for the NRF52840_DK, but we only found a NRF52_DK. We do not want to break anything, so we are not flashing your program."

    I think we are going in two different directions. I actually wanted to use this post as kind of a bug report. The thing is:

    - I want to use the mbed os cli

    - I want it to be recognised by 'mbed detect' as NRF52840_DK

    - I would like to use JLink firmware

    - I would like to avoid any further tooling, such as nrfjprog

    If you say: "Yeah, not possible. We build a generic firmware for all nrf52xx platform, and this intentionally led to mbed os detecting them as nrf52DK." It is fine. It makes my work a bit harder, but I can work around it. Then I need to find a way to modify my setup so I can keep things automated.

  • If mbed overrides your wanted settings, I'd recommend asking on the mbed forums about this. It sounds like a issue on the mbed side, if this is a warning/issue through their systems.

  • I debugged through the code, long story short:

    Depending on the firmware producer a different kind of product id is used. I close this.

    Edit: I do not know why it did not show up in my google search till now, but apparently someone already had the same problem, and reported it to the mbed os device (issue link). They have a workaround, but it does not solve the base problem, which is the firmware apparently.

Related