how to use nrf5340 dk to debug nrf52840dongle?

Hi, 

I want to use nrf5340 dk board to debug nrf52840dongle, i have connected two board with a cable and have checked the signal is good( nrf5340 debug out p19 ------ nrf52840 dongle p1), when download hex file to nrf52840, i got following message:

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: /home/yanzhongsan/Nordic/projects/blinky_pwm/build/zephyr/zephyr.hex
ERROR: Unable to connect to a debugger.
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.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 33: nrfjprog --program /home/yanzhongsan/Nordic/projects/blinky_pwm/build/zephyr/zephyr.hex --sectoranduicrerase --verify -f NRF52 --snr 1050067714
The terminal process terminated with exit code: 33.

my system is ubuntu 20.4, vscode with extension nrf connect, when disconnect nrf52840dongle, i can download hex file to nrf5340 onboard

i have read the nRF52840 Dongle Programming Tutorial, and found this:

To avoid problems if you are using a debugger without level shifter (such as a nRF52840 DK):

  • Avoid erasing the UICR of the chip (i.e. do not do a full chip erase).
  • If you must erase the UICR, make sure that you do not reset the board until after you have programmed either REGOUT0 directly or firmware that sets it.
  • Alternatively, modify the dongle as explained under External regulated source and supply the dongle directly from the nRF52 DK (assuming it is used as a debugger).

i have several questions:

1. how to avoid erasing the UICR

2.how to fix this download issue

and i noticed nrf52840dongle will enter bootloader mode when insert it into usb port when it already connect to nrf5430dk

thanks

Parents Reply Children
Related