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 September 04, 2015 at 18:49

NOTE: edited by moderator on Oct 6th, 2016

Hi Clive

How you doing dude? 🙂

Thanks for reply.

This is the situation of the Reset pin in my board:

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

How can I know that my MCU is working or not?

now that supply is 2v5, the voltage on some pins of the MCU is around 1v2. also not all of them. and What about BOOT0 and BOOT1? I pulled-up or down BOOT0 but nothing happened.

stm32forum
Associate II
Posted on September 18, 2015 at 09:38

Very bad designed pcb.

Difficult to see on the picture but it looks the traces are barely touching the pads of the stm.

For example the xtal traces, but there are numerous of them.

0690X000006034eQAA.jpg

Buy for $4 an board on ebay to start with. http://www.ebay.com/itm/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-For-Arduino-DHUS-/321569700934?hash=item4adf0c3c46

rozehtiyan
Associate II
Posted on September 18, 2015 at 13:38

Hi Edje

On real board everthing is ok and I checked them with a DMM in diode(Beep) mode.

Posted on September 18, 2015 at 14:59

I like to build boards that are easy to debug, and work first time over. Putting a standard 20 or 10-pin ARM debug header makes that connectivity easier.

Check the supply pins

Check the state of the NRST pin

Double check the SWD/JTAG connectivity, that you haven't mirrored or reversed what you think is pin 1, etc.

Using the BOOT0 High, and USART1 PA9/PA10 trick you could confirm if it's just a debugger connectivity issue, or if the part is just not running.

I think we've check the orientation, the supplies, especially the analogue ones, are the next. Check for opens/shorts. Check that the pin numbering is all correct in the design files, Make sure the netlist connects all the nets as you expect, and there aren't unconnected islands, and the schematic/net/pcb don't throw any design rule checks.

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 September 18, 2015 at 18:42

Thanks Clive for reply

It's a puzzle to me what do you mean ''Check the state of the NRST pin''? because as you can see I have pulled it up with a 10KOhm then it's always is in High state. should I disconnect(cut out) the pull up resistor and check the state of the NRST?

What information it will give me if NRST is High or Low?

Posted on September 19, 2015 at 00:50

It's a bi-directional pin, the STM32 can clamp it low, this will occur if the POR circuit thinks the analogue supplies aren't above threshold, or the internal regulation isn't working.

The debugger should also be able to control it to get the part into a known condition.

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 September 19, 2015 at 14:40

Thanks

I measured the NRST pin. it's 2.33 while the supply is 2.5. is it ok?

Posted on September 19, 2015 at 15:47

Well that's a positive sign, so now you want to see if you can talk to the system loader.

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 September 20, 2015 at 19:42

It's a bit hard to do it because there is no pin header connected to PA9 and PA10.