I. Brief description

1. This design has ST-link V2.1 on board, which has virtual serial port function and can complete program download and serial port debugging. At the same time, there are 2 LED indicators, 2 external buttons, and 0.91-inch IIC protocol OLED on board.
2. About ST-link V2.1 and ST-link V2: V2.1 has more virtual serial port functions than V2, and the firmware is larger than V2, so a 128KB capacity chip is required.
3. This design uses 2 single-chip microcomputer chips. The top layer is used as ST-link V2.1, which can be replaced by AIR32F103CB, otherwise only STM32F103CB (128KB) can be used, and the price of ST chips may be higher. The bottom layer chip is used as the main control chip, and ST genuine chips or domestic alternatives can also be used.
4. The welding and production of this circuit will be more complicated, and it is recommended that friends with certain hands-on ability and problem analysis ability get started.
5. Regarding components, the screen uses a certain park, and the following

crystal oscillator uses a three-pin passive crystal oscillator to reduce the overall volume. The other components are basically 0603 package, and there is a fuse in 0805 package.
2. Production and debugging steps
Tool preparation: soldering station, solder paste, heating station, hot air gun, tweezers, a usable ST-link, 4 female to male DuPont wires, and a USB-TypeC cable that can transmit data.
Software preparation: STM32 ST-LINK Utility, firmware, verification program (all files are attached)
1. The first step of
board welding is to weld from the bottom layer, solder paste and heating station, and all the patch devices on the bottom layer can be pasted on (the pin header shown in the figure must be the last and last to be welded, and the process picture was not taken when it was done)
2. The second step
is to weld the top chip and Type-C interface, and at the same time, weld the exposed pads on the bottom layer with the male end of the DuPont wire to download the program to the chip. The DuPont wire and the VCC and GND of the board do not need to be welded, just press them directly on the pin header hole with your hand. Finally, check whether there is a short circuit after welding these, and proceed to the next step if there is no short circuit when powered on.

3. The third step
is to open the STM32 ST-LINK Utility, connect the female end of the Dupont line to the STlink module, and the male end to the board. Then plug the STlink module into the computer.


Use the STlink module to connect the chip.

Select the firmware STLinkV2.J28.M18.bin to download. Do not move during the download process, otherwise the download may fail.
4. The fourth step
is to update the firmware .
Unplug the STlink module, connect the board to the computer using a type-C cable, and open the upgrade tool from the STM32 ST-LINK Utility. This is a must-upgrade.
Come to the key step, click Device Connect, if everything is normal, it will be displayed as follows. If it is not normal, it is generally a welding error, or it needs to be unplugged and connected to the computer several times before it can be recognized. This is also where the pit point appears.

Here, click OK, and then click Device Connect again
to see the original firmware version and the target version to be upgraded. Click Yes to upgrade. Do not move in the middle, it may get stuck as shown in the figure below.
If it gets stuck, try again .

Here it is displayed successfully. Re-plug and connect the computer, the STlink and serial port devices will be recognized, and multiple U disk devices will appear at the same time.
5. The fifth step
is to complete the welding of the remaining components. Burn the test bin file code to verify that there is no overall problem.

After the burning is completed, you need to manually press the reset button. The effect is as follows: the blue light is always on and the green light flashes quickly (the color of the video converted to GIF is a little faded).

It can be used after verification. In the future, only a Type-C cable is needed for downloading and debugging. The above demonstration shows the download of the virtual U disk. You can download directly in the Keil software on a daily basis. I am too lazy to demonstrate the serial port.
3. About the attachments
①.STM32_F1_Test.bin——Used for the final verification that the board welding is correct and the function is normal
②.STLinkV2.J28.M18.bin——STlink V2.1 firmware
③.STM32 ST-LINK Utility v4.3.0 setup——STM32 ST-LINK Utility software installation package, used to install the software and flash the firmware