cancel
Showing results for 
Search instead for 
Did you mean: 

My debugger [J-Link] cannot recognize and erase or download the program to the MCU [SWD]

rozehtiyan
Associate II
Posted on September 04, 2015 at 13:33

NOTE: edited by moderator on Oct 6th, 2016

I'm working on my board to erase or download the program to the MCU. my MCU is STM32F103RBT6 and my programmer/debugger is J-Link. I have wired up the JLink to MCU like this. this is the JLink:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

Due to this pinout:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

And for my board(Please consider that R2 and R3 both are 10KOhm):

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

When I hook up the board and the debugger, looks like everythings are ok. Vcc is 2v5 and there is no connection(or short) between SWDIO and SWCLK pins to other pins. but I cannot connect the debugger to the MCU. my IDE is Keil. it give me this error:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

and then:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

I also have a STM32F0 board and always use this way to connect to it and I don't have any problem.

When I connect the debugger to the STM32F103 this way, both LEDs(red and green) on the J-Link are light. but when I connect Pin15(Reset) of the J-link to the Reset pin of the MCU, just green LED is light. and when I trying to connect to the board, I get these errors:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

and then:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

What's the matter with my board? should I connect the Reset pin of J-Link to the Reset pin of the MCU?

#flash #stm32f103 #swderror #erase
15 REPLIES 15
rozehtiyan
Associate II
Posted on October 17, 2015 at 15:14

Hi clive

Thanks. I solved my problem. the problem was an unconnected GND pin to GND. I connected it and could program/erase it.

After a couple days, I changed my MCU to STM32F103RET6 but I got problem again. I get the previose errors(meantioned earlier in the above posts) again and this:

http://img4.uplood.fr/free/ydbr_dkhjkgfydigyfdg.png

Sounds like it can receive an ID. I measured the current and it's 6mA.

Posted on October 17, 2015 at 15:34

Ok, but you don't have NRST connected on your debug header, right?

So connecting under reset isn't going to help.

Does the debugger connect if you pull BOOT0 high? If so look carefully at your code, and make sure it doesn't break the GPIO pins used for SWD/JTAG, and you aren't putting the chip to sleep or using WFI instructions.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate II
Posted on October 17, 2015 at 18:13

Right.

No.

rozehtiyan
Associate II
Posted on November 28, 2015 at 16:08

NOTE: edited by moderator on Oct 6th, 2016

I removed the problems of the PCB and now this is the PCB:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

But I have the same problem still. I have checked the connections on the board for short circuit but there is no problem. alone unusual thing that I can see is 100nf capacitors. there is no capacitor near each Vdd and Vss pin. could it be the problem?

rozehtiyan
Associate II
Posted on November 28, 2015 at 17:14

NOTE: edited by moderator on Oct 6th, 2016

I'm not sure but I guess I found the problem. this is the SWD connection of my MCU to pin-header:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

And on discovery board whole of connection is this:

[[this link/image has been flagged as malicious by our security scan software and has been deleted]]

There is no pull-up or pull-down resistor. I pulled-up both SWDIO and SWCLK pins. is it incorrect? What's your opinion?

Posted on November 28, 2015 at 22:55

Well there's clearly not the one-to-one connectivity, and there is not NRST connectivity.

Assuming you have an old VL Discovery, because that has fewer pins than later models.

1

2 SWCLK

3 GND

4 SWDIO

vs your connector

1 GND

2 SWCLK

3 SWDIO

4 3V3

I'd probably not connect the 3V3 here, as the ST-LINK built on the DISCO doesn't need or have buffers using this. For the stand-alone ST-LINK, the target supply is used to power the voltage-converter buffers between the pod and the target.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..