Skip to the content
PCBKitNew board
4 layers30 × 18 mmFdcanusb, the printed circuit board in 3D

fdcanusb adapter

Size
30 × 18 mm
Copper layers
4
Thickness
1.6 mm
Parts
36
Nets
62
Pads
157
Tracks, vias
373, 66
Pours
6
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
7 Oct 2019
Updated
6 Oct 2026

Overview

Fdcanusb is an open-source printed circuit board by mjbots, from the mjbots/fdcanusb repository on GitHub, published under the Apache-2.0 licence. It is a 4-layer board of 30 × 18 mm with 36 parts on 62 nets, routed with 373 tracks and 66 vias.

It is built around the STM32G474CEU6, TCAN1057AEVDRQ1 and TLP3317(TP15,F, with the USBLC6-2SC6, B6B-ZR-SM4-TF(LF)(SN) and S3B-PH-SM4-TB(LF)(SN) among its other parts. Its parts include 13 capacitors, 8 resistors, 5 ICs, 5 connectors and 4 diodes. It belongs with the interfaces and adapters boards and the STM32 boards of this library.

Main components

7

README

README.md

mjcanfd-usb-1x / fdcanusb

The mjcanfd-usb-1x and fdcanusb provide access to a CAN-FD bus using a USB 2.0 full speed connection. They present two possible interfaces:

  1. A gs_usb interface compatible with the Linux kernel gs_usb socketcan driver
  2. serial-like interface over the USB port using the CDC ACM class, i.e. a virtual COM port.

The designs and firmware are licensed under the Apache 2.0 License.

  • CI Status

Pre-assembled hardware can be purchased at https://mjbots.com/products/fdcanusb

Usage with moteus tools and libraries

To use a device with moteus tools or libraries, first install the relevant udev rule following the instructions in the top of the file:

Second, just use the application. moteus utilities like moteus_tool, tview, and the python and C++ libraries will automatically discover any connected devices and use the CDC protocol.

USB CDC Protocol

Each command or response is a single newline terminated line, composed of 7-bit ASCII encoded characters. Every command sent from the client to the device has a response which consists of an optional command specific response followed by a final line consisting solely of OK or ERR <details>.

States

The device can be in one of two states.

  1. Bus Off: This is the initial state of the device. In this state, no frames may be sent or received, but the device may be configured.

  2. Bus On: In this state frames may be sent and received, but configuration is locked out.

Commands

Sample commands are prefixed with > to show the data sent from the client to the device and < to show the values sent from the device to the client. Those characters are for illustrative purposes only, and are not present in actual communications.

conf

The "conf" command is used to read and set configuration values. It has several subcommands.

conf enumerate

This emits all current configuration values one after another.

conf get

This queries the value of one specific configuration item.

text
>conf get sample.value
<31235
<OK
conf set

This sets the value of one specific configuration itme.

text
>conf set sample.value 1234
<OK
conf load

This loads all persistent configuration from the persistent storage.

text
>conf load
<OK
conf write

This stores all configuration values to persistent storage. They will then be the default when the device is powered on the in the future.

text
>conf write
<OK
conf default

Reset all configuration values to their "default" state.

text
>conf default
<OK

can

can on

Enter the "Bus On" state. All configurable values are validated and put into place. This results in an error if the device is already in the "Bus On" state.

can off

Enter the "Bus Off" state. Transmission and reception of CAN messages is halted, and configurable values may be changed.

can std

Send a standard CAN frame. The following format is used.

can std <HEXID> <HEXDATA> <options>

options may be zero or more of the following optionally separated by spaces.

  1. B/b require/disable bitrate switching
  2. F/f require/disable FDCAN format
  3. R/r require/disable remote frame
can ext

Send an extended CAN frame. The following format is used.

can ext <HEXID> <HEXDATA> <options>

The allowable options are the same as for can std.

can send

Just like std or ext, but auto-detect the ID type.

can status

Report the current mode and status of various flags.

text
>can status
<mode:BUSON
<OK

Receiving CAN Frames

When in the "Bus On" state, the device may spontaneously emit the following lines upon receipt of valid CAN frames or other errors.

rcv

A CAN frame has been received.

text
<rcv <HEXID> <HEXDATA> <flags>

flags may be zero of more of the following separated by spaces:

  1. E/e frame was received with extended/classic ID
  2. B/b frame was received with/without bitrate switching
  3. F/f frame was received in fdcan/classic mode
  4. R/r frame was remote/data frame
  5. tNNNNN timestamp of receipt measured in microseconds
  6. fNN integer ID of which filter matched this frame

Configurable Values

The following items may be configured.

  • can.bitrate - The bitrate used for the CAN frame (or header only if bitrate switching is used.

  • can.fd_bitrate - The bitrate used for the data and CRC field when bitrate switching is used.

  • can.sample_point - The sample point for the nominal part of the CAN frame. moteus requires 0.666, some other systems default to 0.75, 0.8, or 0.87.

  • can.fd_sample_sample - The sample point for the data (BRS) part of the CAN frame. moteus requires 0.666, other systems may require alternate settings.

  • can.automatic_retransmission - When true/non-zero, frames will be retried until acknowledged.

  • can.fdcan_frame - By default, send frames in FDCAN mode

  • can.bitrate_switch - By default, switch to the can.fd_bitrate for the data and CRC fields.

  • can.restricted_mode - Only transmit acknowledgements.

  • can.bus_monitor - Transmit nothing.

  • can.termination - Enable the onboard terminator

  • can.autostart - Enter BusOn immediately at power-on

  • can.autorecover - Automatically recover from bus off events

  • can.global.std_action

  • can.global.ext_action

  • can.global.remote_std_action

  • can.global.remote_ext_action

    • 0/1 - accept
    • 2 - reject
  • can.filter.N.id1 - first ID

  • can.filter.N.id2 - second ID or bitmask

  • can.filter.N.mode

    • 0 - range
    • 1 - exact match
    • 2 - bitmask
  • can.filter.N.type

    • 0 - standard
    • 1 - extended
  • can.filter.N.action

    • 0 - disable
    • 1 - accept
    • 2 - reject

gs_usb interface

To use the device with a socketcan driver on Linux, the normal socketcan utilities can be used. For instance, to bring up an interface compatible with moteus (not usually required because moteus tools and libraries will by default use the CDC interface), you would do:

bash
ip link set can0 up type can \
  bitrate 1000000 dbitrate 5000000 \
  sjw 10 dsjw 5 \
  sample-point 0.666 dsample-point 0.666 \
  fd on

Then, all messages received can be displayed with:

bash
candump can0

Building firmware

To build the firmware on an Ubuntu 22.04 or newer system.

text
sudo apt install curl openocd
./tools/bazel build //...

To flash:

text
./flash.py

Parts

36
QtyValueFootprintReferences
80.1uFCapacitor_SMD:C_0603_1608MetricC2, C4, C6, C7, C8, C9, C10, C12
4220Resistor_SMD:R_0603_1608MetricR5, R6, R7, R8
31uFCapacitor_SMD:C_0603_1608MetricC5, C11, C13
3Conn_01x01TestPoint:TestPoint_THTPad_1.0x1.0mm_Drill0.5mmJ3, J4, J5
25.1kResistor_SMD:R_0603_1608MetricR3, R4
2GREENLED_SMD:LED_0603_1608MetricD1, D3
2REDLED_SMD:LED_0603_1608MetricD2, D4
110uFCapacitor_SMD:C_1206_3216MetricC1
1110Resistor_SMD:R_1206_3216MetricR2
1330Resistor_SMD:R_0603_1608MetricR1
14.7uFCapacitor_SMD:C_0603_1608MetricC3
1B6B-ZR-SM4-TF(LF)(SN)fdcanusb:B6B-ZR-SM4-TFLFSNSWD1
1Conn_01x03fdcanusb:JST_S3B-PH-SM4-TB(LF)(SN)J1
1STM32G474CEU6fdcanusb:UFQFPN-48_7X7X0P55MMU1
1TCAN1057AEVDRQ1fdcanusb:SOIC-8_3.9x4.9mm_P1.27mmU2
1TLP3317fdcanusb:TLP3317U3
1TLV70233DSERfdcanusb:DSE0006AU5
1USB4110-GF-Afdcanusb:USB4110-GF-A_GCTJ2
1USBLC6-2SC6fdcanusb:SOT23-6L_STMU4

Questions

How big is the Fdcanusb PCB?

It measures 30 × 18 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Fdcanusb use?

36 parts, built around the STM32G474CEU6, TCAN1057AEVDRQ1, TLP3317(TP15,F and USBLC6-2SC6. 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 Fdcanusb KiCad files?

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

Can I use the Fdcanusb design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 6 layers56 × 56 mmMoteus x1, the printed circuit board in 3D

    Moteus x1

    mjbots/moteus

    Brushless DC motor controller

    187 parts1.4kApache-2.0
  • 4 layers60 × 32 mmSUNNY C1-MAIN, the printed circuit board in 3D

    SUNNY C1-MAIN

    RSXLX/sunny-the-growing-sunflower-lamp

    SUNNY — The Growing Sunflower Lamp | A personal lamp with customizable exteriors, traceable fabrication, and a local creative workspace.

    33 parts
  • 2 layers88.5 × 65 mm26-27 Redesign BDC Board, the printed circuit board in 3D

    26-27 Redesign BDC Board

    CornellMarsRover/KiCad

    This folder serves as the central repository for all KiCad PCB designs across multiple years. Each subfolder corresponds to a specific design cycle and contains all associated board files, schematics, and documentation.

    152 parts
  • 4 layers52 × 52 mmServo Board, the printed circuit board in 3D

    Servo Board

    KyleMui/Portfolio

    111 parts
  • 4 layers90.2 × 95.9 mmHEDGE2-SCI, the printed circuit board in 3D

    HEDGE2-SCI

    yrromero04/HEDGE2-SCI_PCB

    87 parts
  • 4 layers90 × 50 mmIkeda MainBoard, the printed circuit board in 3D

    Ikeda MainBoard

    ararobo/ROBOCON_2025_A_PCB

    164 parts3MIT