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
  • Hi,

    thanks for the quick answer.

    Yes, the dongle is connected to the JLink through the 9 pin Cortex M adapter.

    Alltogether, it looks like this:

    I believe the pinouts are correctly connected.

    Also, I've tried with power supply over JLink and without it. Both cases produce the same error.

    To reiterate - when executing nrfjprog  command, both  dongle and the JLink were plugged in the PC. Immediately after starting nrfjprog, red LED started pulsing slowly on the dongle.

    Best Regards,

    Vladimir 

  • It could look like you have mounted the socket the wrong way on the image, the opening on the socket should face this way (towards pin 1 on the solder pads):

  • Hi Jørgen,

    Sorry - I've sen't the wrong picture, the dongle was plugged correctly - I've taken care that pins match.

    This is correct connected state, and only this is how I attempted to perform flash.

    Still the same problem:

    C:\Users\vladimir\zephyr\samples\bluetooth\hci_uart\build>ninja flash
    [0/1] Flashing nrf52840_pca10059
    Using runner: nrfjprog
    Flashing file: C:/Users/vladimir/zephyr/samples/bluetooth/hci_uart/build/zephyr/zephyr.hex
    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.
    error: command exited with status 33: nrfjprog --program C:/Users/vladimir/zephyr/samples/bluetooth/hci_uart/build/zephyr/zephyr.hex -f NRF52 --snr 609301412 --sectoranduicrerase
    run as "west -v ... flash ..." for a stack trace

    nrfjprog return code is 33, and based on now outdated document - it's what we already knew - some kind of JLinkARM.dll problem.

  • Have you tested to flash any of our development kits with the same J-Link? I tested a J-Trace Pro with the dongle, and I'm able to flash it just fine with nrfjprog.

    Error -102 from JLinkARM.dll indicate that the nRF chip was not found.

  • I have flashed multiple ATMEL boards with this same JLink, so I believe it works correctly.

    So immediately after the nrfjprog command is executed, red LED starts pulsating on the nRF52840 dongle.

    It's strange that the nRF chip is not found, since this dongle works just fine with nRF Connect software.

    So it must be something on the nrfjprog/JLink side.

    EDIT : I've tried with another JLink Plus adapter - no success. Still the same error message. 

Related