Introduction
Sharing an article I wrote previously.
Recently, due to a price war between two PCB manufacturers, prices dropped multiple times in a single day, which was quite lively. Jiepei dropped to a minimum of 3 yuan per unit, while Jialichuang dropped to a minimum of 5 yuan per unit, both with free shipping via SF Express. However, Jialichuang waived the color fee, while Jiepei did not. As a bystander, I quickly took advantage of the situation. I had some components left from my graduation project, so I submitted a small JlinkOB board that I had previously practiced drawing. I had always used Jialichuang before, but this time I decided to try Jiepei, mainly because it was cheaper! Now that the price war has ended, I just checked both companies’ websites, and Jiepei has returned to 30 yuan per unit, while Jialichuang remains at 5 yuan. I used the open-source JlinkOB solution online, with the main control being the STM32F103C8T6. I downloaded the official JlinkOB firmware from Segger, and it has been quite stable after some time. Now I am sharing it with everyone, including the PCB files, schematic files, firmware, etc., with the download link at the end of the article.
Hardware Circuit
Schematic

The schematic is quite simple, consisting of the minimum system for STM32 + resistors and capacitors. I haven’t fully understood the specific principles yet. The USB interface is connected to PA11 and PA12, and these two pins of the STM32 can be used to simulate USB devices. Additionally, when I designed it, I did not consider some protective circuits, such as self-resetting fuses, so be careful not to connect it incorrectly during actual use!
PCB

From the perspective of PCB layout and wiring, it’s average. At the time, I was just learning Altium Designer and hadn’t drawn many boards, but it works perfectly in practice, easily reaching speeds over 50MHz. I’ve been using it for a while now, and it’s quite stable.
Soldering and Debugging

Jiepei’s shipping speed is quite good; perhaps because the board size is small, it was shipped within 24 hours. I ordered 5 pieces, but surprisingly received 6. This can be understood as it helps with panelization.
I soldered two small boards, and soldering wasn’t difficult. Most of the resistors and capacitors are 0603 packages, which are relatively easy to solder.

If you don’t have a resistor of a specific value, such as pull-up/pull-down resistors and current-limiting resistors, you can replace them with resistors of similar values. However, for certain resistors, it’s best to use the corresponding values, such as R5 and R12. If they are different, it may cause USB recognition failures.
Once you ensure the power supply is fine, you can download the firmware. Use another debugger, along with JFlash or ST-LINK Utility software to program the hex firmware in SWD mode. After powering it on again, you should see a new Jlink driver in the device manager. Open Keil, select the Jlink debugger, and check if it works. The first time you use it, it will prompt you to upgrade the firmware. You can safely click upgrade, which will update the current JlinkOB firmware to the latest version. After connecting the ARM chip, such as STM32, via SWD, you should see that the chip is successfully detected, and it supports speeds up to 50MHz.

For how to download the Hex file to STM32 separately, you can refer to another article: Jlink Tips for Downloading HEX Files to Microcontrollers
The structure of this board is designed according to a plastic case sold on Taobao, but it can also be used without a case. The assembly effect is shown in the picture.

Areas for optimization and improvement:
-
Optimize layout and wiring.
-
Add self-resetting fuses to prevent short circuits.
Additionally, there is an open-source project online that combines ST-Link and JlinkOB into one debugger. By downloading different firmware, it can be used as either JlinkOB or ST-Link, and it also supports virtual serial port functionality. I plan to make one to play with when I have time.
Resource Downloads
-
Project package download:
https://wcc-blog.oss-cn-beijing.aliyuncs.com/BlogFile/Jlink_OB_DIY.rar
-
Gitee open-source address:
https://gitee.com/whik/Jlink_OB_DIY
Welcome to
<span>Fork</span>&<span>Star</span>
Selected Historical Articles
-
Verilog Implementation of Generating PWM Waves with Arbitrary Duty Cycle
-
Networking Calibration Clock Based on uFUN Development Board and Expansion Board
-
Solution to STM32 Serial Port Printing Garbage Characters
-
One-Click Automatic Formatting of Your Code
-
Qt Small Project: Serial Port Assistant to Control LED
-
Jlink Tips for Reading the Internal Program of STM32
-
Jlink Tips for Programming SPI Flash Memory Chips