cancel
Showing results for 
Search instead for 
Did you mean: 

F401C barebone, minimum circuit.

Manny12
Associate III

Hi

I'm new to STM32, I'm jumping from Arduino, and I'm out of my depth, perhaps I can humbly ask for some help.

I've done basic projects with the Nucleo board, and I wanted to give a try with a simple code on a barebone chip

I have this STM32F401CBU6 on UFQFPN-48, mounted on a Proto-Advantage SMT to Breadboard adapter, naked, just the MCU, no decoupling capacitors, pull-down resistors, etc., just naked.

I intend to put it on my breadboard, power it with a 3.3V Power Supply, and program it to blink a LED.

The code will be written with the CubeIDE and loaded via a Nucleo 64 reference board UM1724, which has an integrated STLink that according to the documentation, can be decoupled for the onboard STM32 target (by removing some header pins) and then used to program an external STM32 via SWD

Chapter 3.13 of the IC F401xB datasheet (that is the external MCU I'm using) talks about the power scheme, and I was wondering:

To just power on the MCU and receive SDW program, do I need to provide power to all VDDs or just VBAT?

What would be the bare minimum circuit that would let me read/write registers, load firmware, etc?

I know, out of my depth, but perhaps I can find my way in this maze.

1 ACCEPTED SOLUTION

Accepted Solutions

> Put a 4-pin connector for programming/debug: Vdd, SWDIO, SWCLK and GND.

I would add NRST, too.

I would also think about the role of VDD - it may be a power connection, or it may be just so that the STLink can measure the target's VDD (which influences programming algorithm at low voltages, or with the galvanic-decoupled STLink it provides the required output level), or it may be unwanted (if both STLink and the target connects this pin to their respective power rails while both being powered from a different source).

You may want to put signals on this connector in a particular order, eg. as they are on the Nucleo board. Even if you want to put them to some other order, it's a good idea to place GND in between SWDIO and SWCLK, so that it shields one from the other if a flat cable is used.

Don't use long cables, 15 cm should be mostly it.

But if you don't intend to build a PCB, just use the breadboard, these remarks are not that important.

OTOH, I hate solderless breadboards and recommend you to avoid them.

> Pull BOOT1 low with 100k.

BOOT1 = PB2, see datasheet.

As long as you don't intend to use the bootloader, just ground BOOT0 and you can forget about BOOT1.

> didnt think about that, how easy/hard is it to spot a fake?

I don't know, I don't have first-hand experience. Based on what I read (including the link I gave and other related threads on that forum), some fakes are very convincingly looking. They may be OK for hobby use, but ST's tools understandably try to detect them and refuse to work with them.

JW

View solution in original post

17 REPLIES 17

The part has a Data Sheet, would help to read it, or at least skim the power and connectivity portions.

Expect to connect ALL power pins appropriately,ie VSS's to ground VDD/VBAT to 3.3V. The VDDA runs the PLL and power-on-reset regardless of you're using ADC, DAC, etc

VCAP pins need capacitors, either one 4u7 or two 2u2 depending on IC. Should see around 1.25V on this if chip is viable.

Don't need crystals or clocks, part starts running from internal oscillator.

NRST should have an internal pull-up. Should see 3.3V if viable.

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

I've been reading the datasheet and I already made all connections for VDD/VBAT/VDDA with their corresponding decoupling capacitors, NRST to 3.3V (missed the VCAP capacitors at the beginning, but connected it later, it seems to need only one), but I got errors when loading my program from Cube IDE, so I went to CubeProgrammer and I was able to sometimes connect to the target, read registers, etc, and sometimes not, and I didn't get the pattern. I was trying to erase the whole chip but some registers didn't let me (protected?), then I tried to change them but the programmer threw errors when I tried removing the protection. I couldn't make more sense of it, so I was looking for a more barebone setup, to simplify and troubleshoot because I thought my barebone setup had just too many wires around. I will take everything apart and wire it again and see what I missed. Hopefully, I didn't fry the MCU with an incorrect connection.

ONadr.1
Senior III

I think, that you need PCB for construction with STM32. They ned weeeery good grounding and blocked capacitors as well. Use STM32 on some breadboard si similar, like driving a lamborghini down a muddy forest road.

You can use the Nucleo module without programer (it is possible to cut it out) as a CPU brick to your own construction.

I did order a PCB, from JLCPCB. With a design made in KiCAD, following a tutorial from Phil Salmony on YouTube, I pretty much replicated his design and added one more 4-pin header to use GPIOs. That PCB is centered around an F103C8 (that's what JLCPCB had in stock).

I haven't gotten it yet, but since I have this other barebone PCB here, I thought I would give it a try and see if I could learn anything.

On every other design I have made I first put all the ICs on a breadboard first, then when I'm happy then I order the PCB, but in this case, since I'm basically copying Phil's design, I ventured to order the PCB without testing on a breadboard first.

I have the hope that I can make work the barebone chip I have here, on a breadboard, nothing fancy, it doesn't have to be perfect or super stable, I just want to see if I can flash it and do something basic.

This is for a hobby, not work, and I know many of you here are paid $$ for your time and your knowledge and I understand many don't want to waste time on these newbie questions. I'm sure that I will be able to ask smarter questions once I have this little thing running.

ONadr.1
Senior III

Yes, I am a hobbyist too. I use usualy whole nucleo board for prototype. This is not so expensive, stable and modular. I know, that is much more bigger then arduino mini and etc. But it usualy doesnt matter in prototype. Or you can use small Blue pill modules with 32F103 or 32F411 and program them wia STLink from Nucleo board.

I just ordered a generic blue pill with an STM32F103C6T6 from Amazon, I'll get it on Sunday. That will help me rule out that I'm making a mistake in wiring/using the STLink part of the Nucleo 64 board I'm using for SWD. I still have hopes of making my barebone chip work though.

For 'F4xx hardware design, read AN4488. Don't forget about BOOTx pins.

Blue pills these days are almost guaranteed to contain a counterfeit chip.

JW

I didnt think about that, how easy/hard is it to spot a fake?

Manny12
Associate III

Schematics attached.

I read the datasheet a few times as some of you advised, and I came up with a minimalistic circuit.

Again, I just want to power on the naked MCU I have, boot it, and load a simple program via SWDIO/SWCLK pins. I made schematics on KiCAD for this. I'm doing this on a breadboard (I know, some might say it will not work, but I asked ST support, and they told me that if I make my connections ‘solid’, they don’t see a reason why it wouldn’t work)

There is something I don't understand, the datasheet seems to indicate that I need to connect the VREF+ somewhere, I think I understand that I should connect it to VDDA which in my UFQFPN-48 package I don't have as a separate pin (the datasheet on page 33/139 says that the pin 9 is VDDA/VREF+ and it says that pin 8 is VSSA/VREF- so I'm more confused now, looks like VREF+ and VDDA are the same pins, and after reading 'power supply scheme' on page 56/139, I decided to wire VREF+ to VDD, in a similar way as the rest of VDD and VBAT, with decoupling capacitors.

I also read the AN4448 (hardware development for STM32F4xxxx) and it says on pages 25/50 and 26/50, that the boot modes are selected by the state of BOOT0 and BOOT1, but I don't have BOOT1 (actually I couldn't find BOOT1 in any package for this MCU)

So, right now, I'm not sure if I'm wiring VREF+ correctly, and I'm not sure how to select each of the three boots modes with only BOOT0

My schematic is here, if anyone cares to review it and critique it, that would be nice.0693W00000Uo7m7QAB.jpg