cancel
Showing results for 
Search instead for 
Did you mean: 

I built a brick

MAkke
Associate III

I designed a board based on an STM32F303CC and I am unable to upload any code to it. I'm using STM32CubeIDE with an ST-Link/V2 programmer. I've connected Pin 7 to DIO and Pin 9 to CLK. The board uses USB for it's 5V power supply which is transformed down to VDD = VBAT = 3.312 V. NRST uses the internal pull-up resistor and measures 3.305V. Boot0 is strapped to GND.

I get error message: (4) "No device found on target".

I connected the GND of the board to one of the GND pins on the JTAG connector of the ST-Link/V2, still error (4). I connected RESET (Pin 15) of the ST-Link to NJTRST on the board connector, still error (4).

I connected NRST of the microcontroller to 3.3V (Pin1) of the ST-Link through a jumper wire, and I get error message: (255) "Unknown, please check power and cabling to target".

I connected 3.3V (Pin1) of the ST_link to VDD/VBAT on the board through a jumper wire, again error (255).

PFA my schematic, all the resistors and resistor arrays are 820 Ohm, except for the BOOT0 Pin which uses 56k. What am I missing?

12 REPLIES 12
Danish1
Lead II

One thing I don't see in your schematic is power-supply-decoupling capacitors. You need 0.1 uF ceramic placed as close as possible to each Vdd / Vss pair of pins.

Microcontrollers are very fast devices, and the inductance of even a centimetre of pcb track is enough to stop things working reliably. And Tantalum / Aluminium Electrolytic are too slow to work.

I don't use ST-Link V2 and I don't know its pin numbers. But you must wire up all the necessary connections with fairly short wires or you'll get reflections and need to clock things very slowly to make it work (assuming you have the choice). I always use ribbon with every other line grounded.

How confident are you that there are no short-circuits on the pcb? I have now given up trying to hand-solder lqfp packages with 0.5 mm pin pitch!

Hope this helps,

Danish

MAkke
Associate III

I used multiple capacitors in my design, all ceramic.

MAkke
Associate III

The closest is C1 at about 0.7 cm, but it's connected through a ferrite bead.

MAkke
Associate III

As for shorts, visual inspection reveals nothing and I cleaned all the flux off the board using solvent and an antistatic brush. What worries me is the continuity testing: sometimes I hear a short beep between two points that are not supposed to be connected, but when I keep the probes in the same position, I don't hear a continuous beep.

The strangest thing about his phenomenon is that it already occurred during assembly: the board was built from small to big, starting with all the passive components, MOSFETs and diodes. Before the first IC's and MCU's were placed, I already noticed this issue somewhere around the 24V to 5V step-down converter. I think it's a capacitor discharge or some hysteresis effect in the inductor or diode, but the board was never powered at that point since it wasn't finished yet, so it doesn't make sense.

Furthermore: how confident can one be that there are no shorts on a board that contains both a 48 and 64 LQFP among other components? Lots of probe combinations possible there.

I've broken it down into all the pins involved here: there are no shorts between any combination of GND, 3.3V, BOOT0, NRST, SWDIO, SWCLK and NJRST the voltages, of GND, 3.3V, BOOT0 and NRST are also correct (see above).

Mike_ST
ST Employee

1) Make sure you've updated the ST-LINK firmware.

2) SWDIO connection only require 4 cable at minimum, it is quite straightforward.

Wiring pin 1 to target VCC is mandatory.

As you said Pin 7 to SWDIO, and PIN 9 to SWCLK, and ground.

I don't use CubeIde, but maybe there is a setting that let you choose the SWD Interface to connect (not JTAG, it requires more wires).

1) There's no way to not update the ST-Link software. Whenever you try to debug a microcontroller through the ST-Link V2, CubeIDE will prompt to update the ST-Link first if it wasn't already using the latest firmware version.

2) Interface settings are set to SWD, not JTAG, since I read somewhere that JTAG is not supported by the ST-Link V2. I don't have a dedicated 3V3 pin on the board, but using a jumper wire from the 3V3 to the ST-Link Pin 1 gives me the aforementioned error (255).

Ferrite beads block the kind of high-frequency that we're trying to decouple, so any capacitors connected via ferrite beads won't help at all.

If that's all you have, it might be worth shorting out the ferrite beads to see if that helps.

As to any pins shorted together, most-likely your pcb-manufacturer didn't build-in any shorts*. It's only when you come to solder in your lqfp that you might accidentally have a solder bridge between adjacent pins. So that vastly reduces the number of tests you have to make. And (at the moment) you only need to worry about those pins essential for the microcontroller to be contacted over SWD (or JTAG).

*I have seen a short in one pcb from a well-known manufacturer. They now claim to test 100% of all pcbs and I haven't seen the problem since.

Thank you very much for your reply, your comments and suggestions are really helpful.

First I will try to solder a capacitor from the corner of VCC/ VBAT to GND and see what that does.

For the oscillator I chose a 24 MHz SMD crystal, it comes with an integrated capacitor (9pF or 18 pF).

I don't think there's a short between the pins of the microcontroller. Solder bridges occurred during assembly, but they are not hard to spot and I made sure to remove all of them before powering the board.

If the capacitor doesn't help I will try shorting the ferrite bead.

MAkke
Associate III

Soldering an extra capacitor between VBAT and GND resulted in error (13) "Unknown, please check power and cabling to target". Shorting FL1 yields the same result.