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

nRF52840 Dongle Firmware Flash

Hi,

due to some evaluation effort of nRF52840 Dongle, I went through whole Zephyr project building of their Bluetooth hci_uart example. After couple of ardous hours(or more), I was finally able to generate appropriate .hex for nRF52840 Dongle(PCA10059).

I also went through the procedure of building drivers for it (nRF's own pc-ble-driver).

When all was done, I was not expecting problems with flashing of the dongle itself. But nevertheless they appeared.

Initially, I was using Zephyr's procedure ninja flash. This basically calls nrfjprog with correct data. I also used nrfjprog directly. I got this error both times:

ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.

Needless to say it persisted, so I have log with error part:

2019-Feb-17 18:21:24  . . . . . nRF52_power_debug_and_system_regions
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register:    JLink:    T83B4740 000:858
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register:    JLink:    JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register:    JLink:      returns -1
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register:    JLink:     (0001ms, 0857ms total)  
2019-Feb-17 18:21:24  . . . . . . nRF52_write_debug_port_register:    JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1.

2019-Feb-17 18:21:24  . . . . . nRF52_power_debug_and_system_regions:    JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102.

2019-Feb-17 18:21:24  nRF_close_dll
2019-Feb-17 18:21:24  . nRF52_close_dll

I have repeated this procedure on windows 10(v1703), and on Ubuntu 18.04LTS.

I'm using all the latest versions of all involved software components.

When I flash, both JLink and nRF52840 Dongle are in ports, so I don't believe this is power related problem.

Could you please be so kind to tell me what could cause this behavior?

I browsed DevZone, and I've seen other people had similar problems with different boards, but no definite solution was mentioned.

Thanks!

Parents Reply Children
  • Unfortunately, I have no nRF5x DK to work with.

    The dongle was plugged in USB, otherwise I get different kind of error which signals that I'm missing power.

    Below is what I tried.

    Case A:

    1. Plug in the dongle in USB, and Plug in JLink in USB.

    2. Execute nrfjprog to try to flash zephyr.hex to dongle.

    3. Immediately after I execute nrfjprog, red led starts pulsating.

    4. JLinkARMDLL.dll problem appears.

    5. Nothing is flashed.

    Case B:

    1. Plug in the dongle in USB, and Plug in JLink in USB.

    2. Press "Reset" button -> Red LED starts pulsating

    3. Execute nrfjprog to try to flash zephyr.hex to dongle

    4.  JLinkARMDLL.dll problem appears.

    5. Nothing is flashed.

    This is exact nrfjprog command I executed:

    nrfjprog --program zephyr.hex -f NRF52 --snr 609301412 --sectoranduicrerase

    Also, I've tried both of these scenarios on Win10 PC, and on Ubuntu 18.04 LTS.

    I'm a little desperate now.

  • I do not see anything that could cause this, except connection issues. Can you check with a multimeter if there are connection between the SWDIO/SWDCLK pinout on the adapter you have in the J-Link Plus to the SWDIO/SWDCLK pads on the dongle close to the USB port, to be absolutely certain that there is not some issue with connection/cable?

  • Ok, for the future generations - it was the cable problem.

    to be more specific, pinout of the cable connecting Cortex M Adapter and nRF52840 Dongle was not correct - SWCLK signal was missing on the dongle. This caused all problems.

    Jørgen, thanks again for the support.

    I had to weld wires directly to the board, but I'm now able to flash it.

Related