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

nRF52832 flashing custom board

Hi,

I know that this question has been asked before but I was wondering if someone can help me understand if the problem is from the connections on my board or my chip is bricked and what the next step would be in my case. I have a custom board and have been trying to flash it via jlink EDU with JFlash Lite. I connected the four required pins SWDIO, SWDCLK, VREF and GND to jlink 20-pin connector pins 7, 9, 1 and 4, respectively. As said here and here, these four pins are enough. Although here it is also suggested to bring out the RESET pin. My first question is:

  • Why does the JLINK datasheet claim that the RESET pin is needed?

In fact first I thought that I missed the RESET pin (because I was not able to perform any erasing or flashing without RESET) and connected it manually to the programmer connector. After this I was able to erase the chip and flash it. But it happened only once and I could not repeat the process. The second question is:

  • Why the RESET pin affected the flashing process? Or does it make any sense that it does so? Is it possible that the JFlash Lite has a different algorithm than for example nrfjprog at least for taking the CPU to the debug mode? And I also tried programming the nRF52 DK through Debug In connected and by JLINK EDU and JFlash Lite. I could not program it without RESET pin connected. But with RESET pin I was able to program it several times and everything was OK.

I got the following error after the first time I could program the device (after this I tried with and without RESET pin connected, but always the same errors):

Erasing nRF52832_xxAA via SWD-Interface@500kHz 
Erase Thread started.
Device "NRF52832_XXAA" selected.
Found SWD-DP with ID 0x2BA01477
Could not power-up debug power domain.
Found SWD-DP with ID 0x2BA01477
Could not power-up debug power domain.
Erase Thread exited 
Initialization of debug session failed.
Could not connect to target.
  • Does this line "Found SWD-DP with ID 0x2BA01477" give any information about the hardware connection? or it might appear even when there is connection problem?

I tried with different values for the frequency. After that I realized I cannot erase the chip anymore, I thought I might have to recover the chip. I tried nRFgo Studio first. I got the error "Recover failed. Can not connect to the device". Then I tried nrfjprog with the following command (as explained here):

 nrfjprog --clockspeed 125 --family nrf52 --recover

and I get the following error:

ERROR: Cannot connect to any nRF device. Please make sure a device is
ERROR: connected to the debugger and supplied.

The power of the device is connected. Otherwise (when there is no power) I get the following error from nrfjprog:

ERROR: Low voltage detected at the target. Please make sure the device is
ERROR: properly supplied.

I did not try programming my custom board by the onboard Jlink programmer of nrf52 DK since I read in one threads that the programmer needs a minimum power about 3V from the custom board. Am I correct? the power in my custom board is 1.8V.

Another question:

  • The RESET pin is configured as IO at the startup, right? because it is pull-down in my board (used as GPIO), and I was thinking if it affects this problem.

I checked the impedance between SWDIO and SWDCLK pins with respect to GND of the circuit. It was several Mohms. I guess it's reasonable right? If so, the soldering is also find in my board.

-Vala

  • Do you know why you only have 2.82V ? I don't have the nRF52DK I only have various nRF51822 boards, and they all have 3.3V supplies mainly via regulators from 5V USB

    But I don't know whether 2.8V is normal for the nRF52DK. You may be able to get a schematic for that DK and check if its supposed to only be 2.8V though it seems a strange voltage to use

  • And I checked some other things:

    1- I checked the DEC outputs of the MCU to make sure that the power is in present for the MCU. I get all the expected values e.g. 0.9V and 1.3V. I also have DCC connected to DEC4 through two inductors.

    2- I checked if the SWDIO and SWDCLK pins have the pull-up and -down voltages. They are also OK.

    So I guess I have all the voltages and connections fine. Now I have only the last option, which is changing the chip, right?

  • Could be the Jlink is faulty, Do you have any other SWD debuggers, e.g. STLink, or CMSIS DAP or BlackMagic probe. (Or do you have any other hardware that you could program to be any of the above.

    Or can you borrow another SWD programmer ?

    I have 2 JLink's I bought from eBay, 2 STLinks, 1 CMSIS DAP and several boards flashed with Blackmagic probe ;-) (but I guess I'm unusual)

  • Appreciate your follow-up Roger. Yes, there is 3.3 LDO on the board but there is a diode after that (for reverse voltage protection) which drops the voltage to 2.87 (what my multimeter shows). As expected, the output from the LDO is 3.3V and the output of the diod is 2.87V on my nRF52DK.

  • Yes, I am able to program the nRF52DK by the jLink EDU that I have.I have also used it for other SoCs/MCUs. But I have never used it with 1.8V.

    There is one strange thing happening with my jLink though. When I connect it to Debug out of the nRF52DK and disconnect the power from the nRF52DK the LED on the programmer turns orange for a little while (which is guess says that the target doesn't have power) and then it turns green again.

    When I repeat exactly the same process with my custom board (which has the 1.8V power source) the LED never turns orange and it stays green.

    This seems to be a problem.

Related