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

    How have you connected the J-Link to the dongle? 

    Best regards,
    Jørgen

  • 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. 

  • You do not have a nRF5x DK that you could try as a debugger instead of the J-Link? The Dongle should be plugged in a USB port when it is flashed, but I understand that you did this? You should anyway get a different error if the dongle was not powered.

    The glowing light indicate that the dongle is in bootloader mode, is this not the case before you try to flash it with the J-Link?

  • 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.

Reply
  • 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.

Children
Related