Skip to main content
Visitor II
October 14, 2022
Solved

F401C barebone, minimum circuit.

  • October 14, 2022
  • 12 replies
  • 4801 views

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.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    > 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

    12 replies

    Manny12Author
    Visitor II
    October 17, 2022

    Any suggestions regarding my VREF+ ? is the connection correct in my schematics?

    Manny12Author
    Visitor II
    October 18, 2022

    Finally !!. It worked!

    I was able to power up my STM32F401CBU6 MCU "minimum circuit" and program it with a Nucleo 64 acting as ST-Link.

    At first, I was getting "Error: failed to erase memory" when flashing from CubeIDE, and I was not being able to remove the write protection on the chip with CubeProgrammer using my Mac, so I used the old STLink Utility on a Windows PC and was able to remove the write protection and then erase the whole chip,, after that, the CubeIDE worked like a charm, and also the CubeProgrammer

    I took some of the suggestions from this thread and experimented a bit. I realized that I didn't need the reset button, just a cap to ground, and I also didn't need the BOOT0 switch, pulling down BOOT0 was enough.

    I added a LED with a current limiting resistor so I could check if my toggle-a-led code worked (I'm using the HAL library)

    Here is the video:

    https://vimeo.com/761308253

    The blink works without the Nucleo board, I just left it there for show and because I'm using 3.3V from it.

    This is my final schematic,, in case anyone at some point wishes to try the same thing I did:

    0693W00000UoEh4QAF.png 

    Thanks everyone !!!! Now that I have a barebone MCU working, I will move forward to other tests.