Skip to the content
2 layers125.3 × 55.3 mmStm32 can lin, the printed circuit board in 3D

Set nSWBOOT0 to 0 using STM32CubeProgrammer for the first time, then connect the debugger and flash the device:

Size
125.3 × 55.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
103
Nets
131
Pads
406
Tracks, vias
726, 212
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
17 Nov 2025
Updated
16 Jun 2026

Overview

Stm32 can lin is an open-source printed circuit board by trnila, from the trnila/stm32_can_lin repository on GitHub. It is a 2-layer board of 125.3 × 55.3 mm with 103 parts on 131 nets, routed with 726 tracks and 212 vias.

It is built around the EPR411A064000EZ, AP2112K-3.3 and USBLC6-2SC6, with the WS2812B-2020, MMBT2222A and NUP2105L among its other parts. Its parts include 30 resistors, 24 capacitors, 17 diodes, 15 ICs and 7 transistors. It belongs with the STM32 boards of this library.

Main components

8

README

README.md

STM32 Triple CAN/LIN USB bridge

STM32G4xx firmware written in Rust using the Embassy framework that bridges CAN-FD buses to Linux via USB using the gs_usb driver and socketCAN interface.

  • 3x CAN-FD channels
    • configurable 120Ω termination resistor

Build & flash & run

Install Rust via rustup.rs.

Set nSWBOOT0 to 0 using STM32CubeProgrammer for the first time, then connect the debugger and flash the device:

sh
$ cargo run --release

Three socketCAN interfaces will appear, for example as can0, can1, and can2. You can configure them using ip command:

sh
$ sudo ip link set can0 type can bitrate 500000
$ sudo ip link set can0 up

After that, you can start sending and receiving CAN frames:

sh
$ candump can0
$ cansend can0 123#abcd

Configuration

All configurations must be done while the interface is in the down state.

sh
$ sudo ip link set can0 down

After the configuration, bring the interface up.

CAN-FD mode and data bitrate

Set CAN to 500 Kbps and CAN-FD to 1 Mbps:

sh
$ sudo ip link set can0 type can bitrate 500000 fd on dbitrate 1000000

120Ω termination resistor

Termination resistor can be enabled in configuration mode via:

sh
$ sudo ip link set can0 down
$ sudo ip link set can0 type can bitrate 500000 termination 120
$ sudo ip link set can0 up

Persistent interface names

Configure udev rules (/etc/udev/rules.d/91-scan.rules) for persistent interface names:

text
SUBSYSTEM=="net", ENV{ID_SERIAL}=="trnila_STM32_CAN_LIN_1", ATTR{dev_id}=="0x0", NAME="scan0"
SUBSYSTEM=="net", ENV{ID_SERIAL}=="trnila_STM32_CAN_LIN_1", ATTR{dev_id}=="0x1", NAME="scan1"
SUBSYSTEM=="net", ENV{ID_SERIAL}=="trnila_STM32_CAN_LIN_1", ATTR{dev_id}=="0x2", NAME="scan2"

and then reload sudo udevadm control --reload-rules and re-plug the device.

Test

Install following dependencies:

Next, connect the DUT's can0 interface to the tester's can1_0 interface, and so on. Then run:

sh
$ CAN_IFACES=0:can0:can1_0,1:can1:can1_1,2:can2:can0_0 ./hw_test.py

Parts

103
QtyValueFootprintReferences
12100nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC3, C6, C9, C10, C12, C14, C15, C17, C19, C20, C22, C24
8WS2812B-2020LED_SMD:LED_WS2812B-2020_PLCC4_2.0x2.0mmD1, D2, D6, D7, D8, D9, D13, D14
610kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR1, R2, R4, R11, R20, R29
656RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR8, R10, R17, R19, R26, R28
6EPR411A064000EZstm_can_lin:SOIC-4_4.7_4.4_P2.54U3, U5, U7, U9, U11, U13
447kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR3, R13, R22, R31
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
3120RResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR12, R21, R30
31kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR15, R24, R33
31nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC13, C18, C23
31uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC2, C4, C5
33k3Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR14, R23, R32
34.7nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC11, C16, C21
36k8Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR9, R18, R27
3DDiode_SMD:D_SOD-323_HandSolderingD4, D11, D16
3DE9_Pins_MountingHolesConnector_Dsub:DSUB-9_Pins_Horizontal_P2.77x2.84mm_EdgePinOffset7.70mm_Housed_MountingHolesOffset9.12mmJ3, J4, J5
3ESD1LIN24Diode_SMD:D_SOD-923D5, D12, D17
3MCP2542FDxMFPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU4, U8, U12
3MMBT2222APackage_TO_SOT_SMD:SOT-23_HandsolderingQ3, Q5, Q7
3NUP2105LPackage_TO_SOT_SMD:SOT-23D3, D10, D15
3TJA1021xTPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU6, U10, U14
3YJL2301FPackage_TO_SOT_SMD:SOT-23_HandsolderingQ2, Q4, Q6
25.1kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR5, R6
29pFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC7, C8
110uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC1
124MhzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSolderingY1
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U1
1BSS123Package_TO_SOT_SMD:SOT-23Q1
1STM32 SWDConnector_PinHeader_1.27mm:PinHeader_2x07_P1.27mm_Vertical_SMDJ2
1STM32G474RETxPackage_QFP:LQFP-64_10x10mm_P0.5mmU2
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U15
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ1

Similar boards

  • 2 layers63.5 × 43 mmOSR RN, the printed circuit board in 3D

    OSR RN

    Open-Things-Network/lora-dev-board

    Uniwersalna platforma sprzętowa na warsztaty i do prototypowania

    77 parts6MIT
  • 4 layers95 × 55 mmGalvanik, the printed circuit board in 3D

    Galvanik

    viridivn/galvanik

    OSHW galvanic hair electrolysis device

    103 parts2
  • 4 layers26 × 30 mmExpansion Card, the printed circuit board in 3D

    Expansion Card

    Churrosoft/BMP_Expansion_Card

    46 parts1MIT
  • 2 layers50 × 40 mmSTM32 CAN USB, the printed circuit board in 3D

    STM32 CAN USB

    mihircn/stm32-usb-can-fd-adapter

    STM32G0B1-based USB-to-CAN FD adapter designed in KiCad.

    31 parts1
  • 4 layers66.7 × 66.2 mmSTM32G474 Dev v3, the printed circuit board in 3D

    STM32G474 Dev v3

    Rennaafi/stm32g474-dev-board

    4-layer STM32G474RE dev board (Nucleo-64 headers, USB-C, CAN-FD, STDC14) designed in KiCad 9: schematic, PCB layout, Gerbers & BOM

    77 partsMIT
  • 4 layers36 × 36 mmFc f405, the printed circuit board in 3D

    Fc f405

    fkontiebo/flight-controller

    Contrôleur de vol 4 layers basé sur STM32F405RGT6, conçu comme plateforme de navigation autonome avec bus CAN.

    97 partsMIT
  • 4 layers66 × 36 mmGas sensor, the printed circuit board in 3D

    Gas sensor

    JamesTwallin/gas_sensor

    A tiny plug-in board for the rev E phone-companion board. It stands upright in a notch in rev E's sensor end, between the two gas sensor cans, and pokes 4.5 mm out through a slot in the case face, so its tip sits in the…

    81 parts7MIT
  • 2 layers45.1 × 43.2 mmStar Notifier, the printed circuit board in 3D

    Star Notifier

    aayanrahman/Star-Notifier

    Star-shaped USB-C ESP32-C3 board that lights up when Claude or Cursor is done

    40 parts

Questions

How big is the Stm32 can lin PCB?

It measures 125.3 × 55.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Stm32 can lin use?

103 parts, built around the EPR411A064000EZ, AP2112K-3.3, USBLC6-2SC6 and WS2812B-2020. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Stm32 can lin KiCad files?

From the trnila/stm32_can_lin repository on GitHub, at the commit this page was made from: the board is hw/stm32_can_lin.kicad_pcb and its schematic hw/can_transceiver.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Stm32 can lin design in my own project?

Its repository states no licence, so its author keeps all rights: ask trnila before reusing the design.