Skip to the content
2 layers49.5 × 29 mmXESC YF r4, the printed circuit board in 3D

[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url]

Size
49.5 × 29 mm
Copper layers
2
Thickness
1.61 mm
Parts
54
Nets
48
Pads
187
Tracks, vias
198, 133
Pours
9
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
1 Jun 2024
Updated
25 Oct 2026

Overview

XESC YF r4 is an open-source printed circuit board by ClemensElflein, from the ClemensElflein/xESC_YF_rev4-adapter repository on GitHub, published under the MIT licence. It is a 2-layer board of 49.5 × 29 mm with 54 parts on 48 nets, routed with 198 tracks and 133 vias.

It is built around the STM32C011F6P6, TPS1H100BQPWPRQ1 and XC6206P332MR-G, with the 1N5819WS, SM4007PL and SMAJ33A among its other parts. Its parts include 20 resistors, 9 connectors, 8 capacitors, 6 diodes and 4 transistors. It belongs with the STM32 boards of this library.

Main components

6

README

README.md

[blocked]

Contributors Forks Stargazers Issues MIT License


xESC YardForce (Rev4) adapter for OpenMower

Simple xESC adapter for stock Rev4 (built 2017) blade-motor
(the one with a internal motor controller under his cap)

v1.x Hardwarev2.x Hardware
HW v1.xHW v1.x

About The Project

Those who want use OpenMower with an older YardForce "Rev. 4" (built 2017) model, fail with the stock Blade-Motor as it has an embedded motor-controller under it's cap.

It's not very difficult to use this motor:

  • Remove stock driver controller
  • Wire the coil cables directly
  • Add a 5 pin cable to the motor hall sensors
  • Connect them to OM's mow-motor-hall-input plug and use OM's xESC.

But it's somehow "crafted" and you need to be capable to do these things.

As an alternative, this "Adapter" is thought to replace OM's default Mow- xESC.
In addition to this adapter, it's nevertheless required to exchange two cables of the mow motor cabling. But this should be also possible for the untalented (see Requirements).

(back to top)

Requirements

It's mandatory to cross the green and black mow-motor-cables!

[!WARNING]
Never plug or un-plug the mow-motor while the adapter is powered!

[!WARNING]
Do not simply trust the cable colors!
Check the image and validate if your cables do have the same colors! If not adapt accordingly

Either exchange the pins within the plug, or do it the lazy way like me, with a luster terminal. The latter has the advantage that you immediately see that you already crossed green/black.

Prerequisites

  • The compiled firmware, which can be found within the Actions section. Click the one you're intersted in (newest or tagged), scroll down to 'Artifacts', download and unzip to somewhere.
  • As of writing, your openmower image has to be on edge version >= commit 0bfd489 which happened on 2024-07-04

Firmware Installation

Requirements

  • You need an ST-Link debugger/programmer, like one of the cheap "ST-Link V2" probes from one of the big online retailer.
  • STLINK Tools >= v1.8.0 (earlier versions do not support the used STM32C0x MCU)

Hardware Version Branding

Starting with hardware version 2.0, the adapters MCU needs to be branded by flashing a hardware config into the OTP area.

Branding Process:
  1. Generate Hardware Config Binaries

    bash
    cd firmware/host-hw-config
    lbuild build
    scons

    This creates i.e.:

    • hw_config_v1.0.bin - Hardware v1.0 configuration
    • hw_config_v2.0.bin - Hardware v2.0 configuration
  2. Connect your ST-Link to the adapter PCB. Do not connect the 3.3V pin if your adapter is already assembled to the OpenMower Mainboard and get powered by it!

  3. Flash Hardware Config

    bash
    # Flash/Brand v2.0 config with ST-Link/V2
    STM32_Programmer_CLI -c port=SWD -d hw_config_v2.0.bin 0x1FFF7000

The branding process writes a small hardware information structure to the first two OTP dwords. Take attention that OTP flash can be written only once!

Important Notes:

  • Branding only needs as well as "can" be done only once per device
  • The branding truly survives firmware updates (because OTP flash can be written only once)
  • Hardware Version 1.x boards don't need branding. Non-branded devices get assumed to be v1.0 hardware

Firmware Installation Variants

We've two options to install the firmware. Either via:

  • ST-Link debugger/programmer, for which you need to have access to the adapter PCB's SWDIO pins, or via
  • Open-Mower's UART via STM32 internal bootloader (which can be done with a closed mower)

Firmware Installation via ST-Link debugger/programmer

Flash
  1. Connect your ST-Link probe to the adapter PCB. Do not connect the 3.3V pin if your adapter is already assembled to the OpenMower Mainboard and get powered by it!

  2. Flash the adapter:

    sh
    st-flash --reset write firmware_xesc_yf_rev4.bin 0x08000000

    When done, st-flash should report 'Flash written and verified! jolly good!' (or similar) and immediately reboot.

    Only relevant for v1.x hardware:

    [!WARNING]
    Do not unplug now!

    On absolutely first firmware boot, it need to flash some settings to the MCU. You'll see some blink codes.
    Do NOT unplug till you see:

    • 3 simultaneous blinks of the green+red LED (=success), following of a
    • quick blink of the red LED (=no motor connected) as well as a
    • normal green blink (=ROS not connected).

    The whole procedure will only take about 10 seconds. Once the procedure got processed it don't get triggered again for this MCU on future firmware flashes.

    If the board doesn't come up with blink signs, unplug and replug it. But once you see blink signs, do not unplug it before getting the described LED codes of the previous paragraph.

(back to top)

Firmware Installation via serial connection (UART)

Firmware flashing via UART is currently only possible with OpenMower V1 based hardware!

Requirements
  • STM32CubeProgrammer is the tool we need to flash via UART. But because we like to use it with our OpenMower's Raspberry-Pi, we need it in aarch64 architecture. Unfortunately (as well as unbelievable) ST's programmer tool for ARM CPU's isn't available for ARM CPU's/architectures!!
    So we need to trick a little bit, and for this you need a non-arm Linux machine (x86_64).
    1. Download STM32CubePrg-Lin package with (or to) a x86_64 Linux machine
    2. Unpack and install it on the x86_64 Linux machine
    3. Pack (zip, tar, ...) the installed binaries from where you just installed them
    4. Copy that package to your Raspberry-Pi and unpack it to somewhere. I placed mine to /opt/STM32CubeProgrammer
  • box64 to be able to run the STM32CubeProgrammer's x86_64 binary with our aarch64 architecture.
    Luckily they do have pre-build Debian packages. Please follow their instruction.

Once box64 got installed, you should be able to start the STM32Programmer CLI i.e. via: /opt/STM32CubeProgrammer/bin/STM32_Programmer_CLI

Flash

  1. Login to your OpenMower Raspberry-Pi and stop openmower:
    sudo systemctl stop openmower

  2. Configure Raspberry-PI's serial device where the adapter is connected to, which is normally /dev/ttyAMA3:
    stty -F /dev/ttyAMA3 115200 raw

  3. Now trigger the current running adapter firmware to do a reboot into the bootloader via:
    echo -e "\x00Reboot into Bootloader" > /dev/ttyAMA3

  4. Check if STM32 MCU is now in bootloader mode (Step 3. was successful):
    /opt/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=/dev/ttyAMA3
    Should output something like:

    text
       -------------------------------------------------------------------
                         STM32CubeProgrammer v2.16.0                  
       -------------------------------------------------------------------
    
    Serial Port /dev/ttyAMA3 is successfully opened.
    Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                        stop-bit = 1.0, flow-control = off
    Activating device: OK
    Board       : --
    Chip ID: 0x443 
    BootLoader protocol version: 3.1
    Device name : STM32C01x
    Flash size  : 32 KBytes (default)
    Device type : MCU
    Revision ID : --  
    Device CPU  : Cortex-M0+
  5. Flash:
    /opt/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=/dev/ttyAMA3 -w firmware_xesc_yf_rev4.bin 0x08000000

  6. Reset the device (start our newly flashed program):
    /opt/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=/dev/ttyAMA3 --go 0x08000000

    Only relevant for v1.x hardware:

    [!WARNING]
    Do not power-off now!

    On absolutely first firmware boot, it need to flash some settings to the MCU. You'll see some blink codes.
    Do NOT unplug till you see:

    • 3 simultaneous blinks of the green+red LED (=success), following of a
    • quick blink of the red LED (=no motor connected) as well as a
    • normal green blink (=ROS not connected).

    The whole procedure will only take about 10 seconds. Once the procedure got processed it don't get triggered again for this MCU on future firmware flashes.

  7. Finally start openmower again:
    sudo systemctl start openmower

(back to top)

OpenMower Config

OpenMower V1 based Hardware (mower_config)

Lastly, you need to add the adapter to your mower_config. Here's the relevant section out of mower_config.sh.example:

text
# Select your ESC type
# Supported values as of today:
# xesc_mini: for the STM32 version (VESC)
# xesc_mini_w_r4ma: for the STM32 version (VESC), but with Rev4 (Mow) Motor Adapter (only available for YardForceSA650 mower type)
# xesc_2040: for the RP2040 version (very experimental!)
# xesc_2040_w_r4ma: for the RP2040 version (very experimental!), but with Rev4 (Mow) Motor Adapter (only available for YardForceSA650 mower type)
export OM_MOWER_ESC_TYPE="xesc_mini"

Once adapted, restart openmower via: sudo systemctl restart openmower

OpenMower V2 based Hardware: (xCore Firmware)

Edit OpenMower stack config via openmower configure env and set FIRMWARE="yardforce-v4"

(back to top)

LED codes

GreenRedDescription
3 * quick blink'Power up' successful
1Hz blinkWaiting for init by xesc_ros
0.5Hz flash
(short flash every 2 seconds)
Shutdown (Sleep) triggered by OpenMower Pico FW
onAll fine (initialized, xesc_ros connected and no error)
1Hz blinkWaiting for OpenMower (xesc_ros driver) connect
flashOne single short flash for every host communication error, like packet or CRC error
onWrong hardware version firmware flashed!
Motor disabled for safety. Flash correct firmware
5 * blinkNRST Pin not yet disabled. Keep board powered and watch for further LED codes
5 * blinkNRST successful flashed
4Hz quick blinkOpen VMC (no motor connected).
WARNING: Do not connect the motor while the adapter is powered!
2Hz fast blinkVMS temperature issue or over-current detected

(back to top)

Self-Compile

This project is build with modm. You need to install the required toolchain as described in their Installation section, before going on.

Once done:

  1. Clone this repository (inclusive submodules):
    git clone --recurse-submodules https://github.com/ClemensElflein/xESC_YF_rev4-adapter.git
  2. Change into the project source directory:
    cd xESC_YF_rev4-adapter/firmware/src
  3. Build the modm library files for a specific hardware version:
    bash
    # This is for v2.0 hardware building
    lbuild -c hw-v2.xml build
  4. Compile the firmware binary:
    scons [profile=<release|debug>] [build]
  5. Flash firmware:
    For this, a specific xPack OpenOCD version is required. Either install your own one, or use the one within the package folder by:
    export MODM_OPENOCD_BINARY=../packages/xpack-openocd-0.12.0-3-linux-x64/bin/openocd
    Afterwards flash the firmware via:
    scons program

(back to top)

Roadmap

(Ordered by priority)

  • Design schematics and PCB
  • Produce PCB
  • Firmware
    • Generic VM control (on/off)
    • Generic motor control (start, stop, break)
    • Read SA, math RPM
    • Open VMC (no motor connected) detection
    • Disable NRST pin functionality
    • Motor current consumption
    • PCB temperature (junction temp of STM)
    • Support shutdown signal
    • Stock motor (wrong) cabling detection
    • STM32 bootloader / flash via UART support (OpenMower V1 based mainboard)
    • UART flash support for OpenMower V2 based carrier-boards
  • ROS driver
    • xesc_ros::xesc_yfr4
    • Add RPM
  • OpenMower Hardware V2 firmware driver

See the open issues for a full list of proposed features (and known issues).

(back to top)

History

Firmware

VersionRelease DateInfo
0.3.02025-10-25- Fix "Open-Load" detection for Rev4-ESC hardware v1.0
- Improve load current and RPM calculations
- Add hardware/firmware mixup protection
- Add support for Rev4-ESC hardware v2.x
0.2.32024-10-03- Add RPM to status package
0.2.22024-08-25- Support STM32 bootloader flash via UART
0.2.12024-08-19- Add shutdown signal handling (sleep/power-off VMC)
- Handle over-temp and over-current
0.2.02024-08-16- Switch from Arduino to modm lib
- Integrate flash procedure to disable-NRST
- Add Motor current and PCB temperature
0.1.12024-07-10- Open VMC (no motor connected) detection
- VMC-short and thermal error detection
0.1.02024-07-05Generic functionality like Start, Stop, Break

Hardware

VersionRelease DateInfo
2.1.02026-12-??- Improve current sense ADC clamping
- Increase HW current limit to 3A
- Minor part and routing adjustements

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/ClemensElflein/xESC_YF_rev4-adapter

(back to top)

Parts

54
QtyValueFootprintReferences
5.1uF/50VCapacitor_SMD:C_0402_1005MetricC2, C4, C5, C8, C9
51kResistor_SMD:R_0603_1608MetricR15, R16, R17, R19, R20
5220Resistor_SMD:R_0603_1608MetricR1, R2, R3, R4, R7
42N7002Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4
447kResistor_SMD:R_0603_1608MetricR5, R6, R10, R11
3Conn_02x02_MaleConnector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_VerticalJ6, J9, J10
3TestPoint_FlagTestPoint:TestPoint_Pad_1.0x1.0mmHV_PB7, PA7, PB7
24.7uFCapacitor_SMD:C_0603_1608MetricC1, C3
2470Resistor_SMD:R_0603_1608MetricR8, R9
24k7Resistor_SMD:R_0603_1608MetricR12, R13
2Conn_01x05_MaleConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ3, J4
2Conn_01x06_MaleConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ7, J8
110kResistor_SMD:R_0805_2012MetricR18
110uF/50VCapacitor_SMD:C_0805_2012MetricC6
11N5819WSDiode_SMD:D_SOD-323D3
13V3Diode_SMD:D_SOD-123D5
1820Resistor_SMD:R_0603_1608MetricR14
1Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2
1Conn_01x09_MaleConnector_PinHeader_2.54mm:PinHeader_1x09_P2.54mm_VerticalJ1
1LED RedLED_SMD:LED_0603_1608MetricD2
1LED WhiteLED_SMD:LED_0603_1608MetricD1
1SM4007PLDiode_SMD:D_SOD-123FD4
1SMAJ33ADiode_SMD:D_SMAD6
1STM32C011F6P6Package_SO:TSSOP-20_4.4x6.5mm_P0.65mmU2
1SolderJumper_2_BridgedJumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mmJP1
1TPS1H100BQPWPRQ1Library:TPS1H100-Q1_ThermalViasU3
1XC6206P332MR-GPackage_TO_SOT_SMD:SOT-23-3U1

Similar boards

  • 4 layers100 × 100 mmA SGSS cskpin routed, the printed circuit board in 3D

    A SGSS cskpin routed

    ThatguyCplus/throttleECU

    STM32F411CE Throttle ECU — PID position control with AS5048A encoder, H-bridge motor, safety module

    571 parts1
  • 4 layers100 × 176.5 mmElevation Pivot Daughter Board, the printed circuit board in 3D

    Elevation Pivot Daughter Board

    mauro-starspec/Elevation_Pivot_Daughter-Board

    KiCad 9 daughter board for the Starspec elevation/pivot controller.

    263 parts
  • 2 layers50 × 40 mmEncoder, the printed circuit board in 3D

    Encoder

    Tomoshibi-technology/RCJ-Japan2024-Circuit

    RoboCup JapanOpen 2024とEindohoven 2024に向けての回路開発

    60 parts1MIT
  • 2 layers5.2 × 66.9 mmXmas Ornament-2024, the printed circuit board in 3D

    Xmas Ornament-2024

    BornaBiro/Xmas-Ornament-2024

    Issues is that STM32 MCU is missing it's GND.

    56 parts1
  • 2 layers100.9 × 144.5 mmSinthinator, the printed circuit board in 3D

    Sinthinator

    phenax/sinthinator

    A capacitive touch slider based music instrument

    57 parts1
  • 2 layersLmwb RGB Ball, the printed circuit board in 3D

    Lmwb RGB Ball

    LMWB/Pasta-alla-Norma

    Circular shaped RGB-LED PCB with integrated Microcontroller and EEPROM

    41 partsMIT
  • 2 layers75 × 65 mmMotormodul, the printed circuit board in 3D

    Motormodul

    Meo98/picostack

    Stackable, contract-driven module system for the Raspberry Pi Pico — open hardware, built by code

    63 partsGPL-3.0
  • 4 layers96.6 × 40.7 mm2026Precharge, the printed circuit board in 3D

    2026Precharge

    SCFormulaElectric/USC-Electrical-Systems

    91 parts9

Questions

How big is the XESC YF r4 PCB?

It measures 49.5 × 29 mm and has 2 copper layers, 1.61 mm thick.

What parts does the XESC YF r4 use?

54 parts, built around the STM32C011F6P6, TPS1H100BQPWPRQ1, XC6206P332MR-G and 1N5819WS. 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 XESC YF r4 KiCad files?

From the ClemensElflein/xESC_YF_rev4-adapter repository on GitHub, at the commit this page was made from: the board is PCB/xESC_YF_r4.kicad_pcb and its schematic PCB/LEVEL_SHIFTER.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the XESC YF r4 design in my own project?

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