STM32 - two errors in turns during programming

Thread Starter

PiotrK

Joined Mar 24, 2014
8
I'm trying to program STM32F107VCT6 via SWD and I'm constantly getting two errors in turns (literally):


  • Error: Connect failed, check config and cable connection
  • Error: Flash driver function execute error, Erase: [ 0%]
By "in turns" I mean that when I click "Download Code To Flash" in CooCox CoIDE, I'm getting the first error, and after the second try, I'm getting the second one.

I have a PCB made from the same schematics with this model of STM32 and it works just fine. Changes between the old board and the new one are very insignificant.

I thought the problem may be in connecting NRST line, but everything is fine. I used 10k pull-up resistor, and the connections seem to be OK. Also, the crystal oscillator looked guilty, but I disconnected it to check if I could program STM32 on the internal oscillator, but it didn't help. All signals are connected correctly and all GNDs are connected together.

Could someone point out some possibilities why STM32 could behave like this? I would be grateful for any help.
 

MrChips

Joined Oct 2, 2009
30,712
I have a PCB made from the same schematics with this model of STM32 and it works just fine. Changes between the old board and the new one are very insignificant.
I presume that to mean that you have a STM32F0DISCOVERY demo board and it connects and programs successfully.

You don't need the external XTAL or the NRST line connected for it to program.
Make sure that all VSS and VSSA pins are connected to GND.
Make sure that all VDD and VDDA pins are connected to 3.3V
Make sure that you have 0.1μF caps at all VSS and VDD paired pins.

What pins have you connected to the SWD connector on the programmer?
Have you made the required changes on the STM32F0DISCOVERY board.
 

Thread Starter

PiotrK

Joined Mar 24, 2014
8
I don't have this eval board, but the programmer works for sure - it can program the slightly older board I designed, with the same uC.

I connected these STM's pins to the programmer: SWD_TMS, SWD_TCK, GND and 3.3V.

Vbat is connected.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,712
I was hoping to see clearer photos so that we can check the pins and look for bad solder joints.

Do you know that the new board works, i.e. that this is not the first test run?

If this is the first test, how do you know that the board and MCU are both good?
 
Last edited:

MrChips

Joined Oct 2, 2009
30,712
I got some fresh new chips today, STM32F429VIT6, never worked with these before.

So I am going to test them on a board that was laid out for STM32F407VGT6.
I know the board is good. I am going to start with just the MCU and power supply decoupling capacitors, nothing more.
 

Thread Starter

PiotrK

Joined Mar 24, 2014
8
I was hoping to see clearer photos so that we can check the pins and look for bad solder joints.
Ok, I'll try to take such photos today.

Rich (BB code):
Do you know that the new board works, i.e. that this is not the first test run?
If this is the first test, how do you know that the board and MCU are both good?
It is the first run and the problem is I don't know if the board itself is OK. So far it seems that it's not - I've tried several different units of this MCU and the behavior was exactly the same.

I got some fresh new chips today, STM32F429VIT6, never worked with these before.

So I am going to test them on a board that was laid out for STM32F407VGT6.
I know the board is good. I am going to start with just the MCU and power supply decoupling capacitors, nothing more.
I see the point - I'd probably do the same to isolate the problem, if only I had more time, but unfortunately I have only one day now to the deadline. As I wrote yesterday, I have this older board which is really similar to the new one and it works just fine. It means that all connections should be logically correct (the schematics are nearly identical, regarding connections to the MCU). There must be something which causes such distinctive behavior of the MCU. I think there is something wrong with the board or rather the way it's been put together, and I'm looking for a clue what it might be.

Can you try if jtag works?
Unfortunately no - all JTAG pins are used for something else and soldered to the PCB in such way that I can't check it.

Despite the deadline, I won't stop trying to run the board, just not in such a big hurry. I'll keep you posted if something new comes up.
 

Thread Starter

PiotrK

Joined Mar 24, 2014
8
If this is the first run on this PCB, how many of these boards have you assembled and tested?
This particular board - none, unfortunately. This is the first and probably the last one. But we already had about 3 similar boards and they worked fine.

We're a small team of students taking part in robotics competitions, so basically all circuits are like prototypes, not mass production. I'm writing in behalf of our electronics engineer so I also may not have the full picture.

Here are the photos I promised. I did my best to make the pins look as sharp as possible:
http://i.imgur.com/gtmiUe3.jpg
http://i.imgur.com/YbQoXTp.jpg
http://i.imgur.com/faoVHil.jpg
http://i.imgur.com/y4YrOSk.jpg
 

MrChips

Joined Oct 2, 2009
30,712
Thanks for the photos. I will look them over but not in time for your deadline.

So these are proto PCBs?
Were they designed and assembled by you?
Someone already assembled an identical board and tested that the MCU connects to the programmer?

I ask many questions because many times the devil is in the details.
That is how I succeed in diagnostic work.
 

kubeek

Joined Sep 20, 2005
5,794
Unfortunately no - all JTAG pins are used for something else and soldered to the PCB in such way that I can't check it.

Despite the deadline, I won't stop trying to run the board, just not in such a big hurry. I'll keep you posted if something new comes up.
Do you have another bare pcb that you could partially populate? Or remove some parts from the problematic board to try out the jtag?
 

Thread Starter

PiotrK

Joined Mar 24, 2014
8
Sorry for not replying for several days. I've encountered a similar problem on another board and just resoldering the uC helped. I'll try to do it also in this case and I'll let you know if it helped.
 
Top