jlink flashing via nrf52840dk

Hi,

We can program our products via older nrf52840dk boards - we are using them as jlink programmer. But not with the recent ones.

We get error on linux and windows machines:

[error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 176 milliseconds with result -102
ERROR: Unable to connect to a debugger
 
How to solve this issue? Are there any uicr registers that need to be set, jlink firmware flashed or sth? Please help.
I'm using latest tools: jlink  V7.96c, and nrf command line tools 10.24.1
Flashing the board itself (without connecting it to our product) alone works fine.
  • uicr_52840.hex

    Apparently yes - some uicr settings need to be set correctly. Why are the new borads not configured like that by default? Provide link/information about the uicr registers.

    To make it work i read the uicr registers from older boards and flashed it to the newer ones, like so:

    nrfjprog --program uicr_52840.hex --verify --reset

  • Hi,

    I am a bit confused about this. You need to be able to debug in order to program the UICR, so if you are, that means you get debugging/programming working? Also, there should not be any need to flash anything to the UICR, and the hex file you have attached has all FF in the UICR, so it is the same as you get after an erase all operation. So I wonder if there is a pattern in when you see this issue and not?

    Without fully understanding the situation, we saw another issue not long ago which was temporarily worked around by using nRF Command Line Tools version 10.23.0 and J-Link 7.88j, so I would suggest that.

    Also, note that if you are programming the latest generation nRF52840, you need to do a recover operation (like "nrfjprog --recover") to open up the debug interface, as it is locked by default.

    PS: I am not sure the Segger licence allows using DKs as production programmers, so you may want to check with Segger.

  • You're rigth. It seems that i can only program REV3 MCUs but not REV2:


    the not working one: 1050271479 - NRF52840_xxAA_REV3   # cant program board (1050283640 - NRF52832_xxAA_REV2), CAN program a NRF52840_xxAA_REV3 board


    the working one: 1050283640 - NRF52840_xxAA_REV3   # CAN program ANY board via its jlink 


    the_working_one.hex

    the_NOT_working_one.hex

  • Hi,

    gorazd said:
    the not working one: 1050271479 - NRF52840_xxAA_REV3   # cant program board (1050283640 - NRF52832_xxAA_REV2), CAN program a NRF52840_xxAA_REV3 board

    What is the version printed on the white sticker on both the working and non-working boards (this tells us the version of the DK, includign which onboard deugger it has)?

    gorazd said:

    Are these .hex dumps of the onboard nRF52840 deviceon on the DK? If so, these are not relevant, as this has nothign to do with the debug out feature.

    Just so I did not misunderstand anything, the problem is debugging/programming external boards via the Debug out port, right? Can you elaborate a bit as there are a few pieces of information here that I am hving trouble to link (like the relevance of the flash content of the onboard nRF52840 device).

  • ok. hex dumps are then irrelevant, i had thought it could be of help if you would could to see the uicr settings from them.


    > Just so I did not misunderstand anything, the problem is debugging/programming external boards via the Debug out port, right?

    yes exactly.

    The version of all nrf52840dk boards is the same: 3.0.0, 2022.36
    but i know the one that is working was bought much earlier, like one year ago. And it might have been that that board was also not working initialy - and i remember to have played with this https://wiki.segger.com/J-Link_OB#Workaround_2 to get it start working.

    Can you recommend flashing these boards with some binaries. I know there are some binaries that can be programmed onto these boards when in bootloader mode.



Related