STM32F4 Black Pill + SimpleFOCShield

Hello all

A few weeks ago I made an adapter board to connect the SimpleFOCShield to the STM32F4 Black Pill and it works great.

I’ve made a lot of projects in the past with Arduino, Raspberry Pi, ODrive, sensors, other modules, … but I never made a custom PCB for these projects even though I wanted to make one for a long time. Now I was thinking why don’t I make a PCB that combines the STM32F4 Black Pill and the SimpleFOCShield on one PCB because I like the MCU a lot and the SimpleFOCShield schematic is easy and I already have an L6234 chip. Also, I’m studying electromechanical engineering so maybe I can use this PCB designing skill in the future, I have some electrics knowledge.

Now the task at hand is reverse engineering the MCU with the given schematic and visual inspection of the board because the schematic is not complete.

I’m making this board for fun and practice, in the future I want to design a better board.

Links to the MCU:

GitHub
STM32-base
Schematic

Questions/thoughts:

  • Flash
    There is a place on the back of the board for a flash chip I will leave this out of my design, I don’t think there is anything I need to worry about when removing this from the schematic.
    image

  • Diode
    there is an S4 diode on the board that is not in the schematic, what does this do and where is it placed? It is connected to the top pin of the USB connector.

  • C13 LED and KEY
    I will also remove the LED on pin C13 and the KEY button, this is just an onboard input button.

  • Crystals
    There are two crystals, the top one is 25 MHz and the bottom one is 32.768kHz according to this website: Black Pill clock sources, but I can’t seem to find the lettering on the chip on the internet which is X2E18A, what footprint is this? Also which one is the LSE and HSE one on the schematic?


  • Voltage regulator
    I wanted to use 2 AMS1117’s, one for 3.3V and one for 5V but the board has a 4B2K regulator, is it better to keep this one, why?
    image

  • KL3 double diode
    There is a KL3 double diode on the board, what does this do and what do VBAT and VB stand for? Can I remove this part of the schematic? Runger already gave me an answer but I want to add this to make this post complete in case someone wants to add to this.
    image

  • Unknown resistor and capacitor values
    How should I go about finding the resistor and capacitor values that are not given in the schematic? Desolder them and measure?

  • Missing component
    I think there is a missing component next to the reset button, any reason why?

  • USB interface
    Does the STM32F4 have native USB support because it does not seem that there is a USB controller on the board or is this done with a certain firmware?

My schematic: SimpleFOCSTM32

Any other tips and ideas are of course welcome!

Thanks for your time and help.

Carelsbergh Stijn

I believe this prevents back-flow of 5V into the USB.

Just take any 25MHz crystal and you can skip the 32.768kHz unless you need a real-time clock.

I’m a little confused, that is the input voltage to the AMS1117 to give you 5V and 3V?

@runger already answered. You can skip the real-time clock and battery power. Also the schematics you posted is clearly incomplete there are many components missing that I can see on the PCB.

No clue, but de-soldering works perhaps? Builds character and eye-to-hand coordination. Also when you get frustrated you can always smack the PCB with the soldering iron to get your revenge.

If it’s missing and the board works, ignore it.

Excellent question. You need to read the documentation.

https://www.st.com/resource/en/datasheet/stm32f411ce.pdf

https://www.st.com/resource/en/programming_manual/pm0214-stm32-cortexm4-mcus-and-mpus-programming-manual-stmicroelectronics.pdf

I’ll have a look at it later.

Cheers,
Valentine

Hi, thanks for the reply

Connect the pins from the 32.768kHz crystal to GND? With or without caps?

I want to have a dc input (screw terminal) and convert it to 5V and 3.3V with the two AMS1117’s, but maybe there is something special about the 3.3V regulator they use that is different from the AMS1117, just a question to be sure.

Great tip :laughing:

Cheers

Carelsbergh Stijn

What is the max voltage you want to give?

These are regular io pins you can leave them floating or use them as io or ground them with 10k resistors.

Hello

I want to use 12V maximum.

I just found a more complete schematic of a newer version of the board, chances of getting it correct are improving.

STM32 Black Pill V3

Cheers

Carelsbergh Stijn

Hello

I’ve not had time to make the PCB but I’ve done a test and explained how the parts work together in a video and wanted to post it here so everyone can find it if needed.

Cheers

Carelsbergh Stijn

2 Likes