FemtoLCC

Firmware

What the firmware does today, what has been tested on a board, how the USB port shows up, and how to flash and update it.

The board runs a single firmware built on OpenMRN, the reference implementation of the LCC standards, as an ESP-IDF project for the ESP32-C6. The source and the full developer notes are in software/openmrn. This page covers what you need to know to use it. For setting the board up, see Configuration.

Where it stands

The firmware is complete enough to configure and drive from a computer, but it has only been run on a bench board with nothing connected to the track outputs or the CAN port. Read the lists below as “known to work” and “written, not yet seen working”, not as a release with a support promise.

Checked on a board

These were exercised over the USB port from a test script, on 25 October 2026:

  • The board appearing as an LCC node with its own node ID, derived from the chip, so two boards never clash.
  • The USB port working as a GridConnect LCC adapter: a clean stream of frames, with no console text mixed in.
  • Reading the configuration description and writing settings, and the reset that a settings-layout change causes.
  • Live control: an output set to DC forward and reverse, to DCC pass-through and to off, all read back, with the DC limit capping requests.
  • Block power events, and the replies when a tool asks about them.
  • A turnout output driving a twin-coil solenoid, with the pulse cut off at one second, and Thrown / Closed events sent.
  • A frog relay on P0 following a turnout, both at once and after a delay.
  • (26 October) A turnout output set to Tortoise: thrown and closed sent about three seconds after the command, and “unknown” given while it travels. Its frog relay on P0 changed over halfway, at about 1.6 s, or at the delay set. Set to Kato: the pulse cut off at 250 ms when a full second was asked for.
  • The WiFi password reading back blank.
  • The board staying responsive over USB with nothing on the CAN port.

Not yet tested on hardware

Everything here is implemented, but nobody has watched it work yet:

  • Track power and detection: current measurement, occupancy, the DC PWM outputs, and the DCC waveform.
  • The CAN bus with other nodes on it.
  • WiFi: joining a network, the hub, and mDNS.
  • Qwiic expansion boards: I/O expanders, servo/light boards and the SparkFun relay boards.
  • A frog relay on a servo turnout, which changes over halfway through the travel.
  • JMRI. The board has been driven from a script that talks the same protocol; JMRI’s own configuration window has not yet been pointed at it.

If you try any of these, the issue tracker is the place to report how it went.

Not implemented

  • Hosting train nodes (an LCC command station). The DCC output is there, but nothing yet turns LCC throttle commands into DCC packets.
  • A web settings page. Configure the board from JMRI or another LCC tool.
  • A command console. The console on J1 prints messages but reads nothing.
  • DCC-EX or WiThrottle throttle protocols.

The USB port

The USB-C port at P1 is the ESP32-C6’s built-in USB port. It is not a separate USB adapter chip, and that changes how it looks on a computer.

It’s listed as “USB JTAG/serial debug unit”

That is the chip’s own name for the port, with the USB IDs 303a:1001. It is fixed in the silicon, so firmware cannot change it to say FemtoLCC. Every ESP32-C3, C6 and S3 board shows up the same way. When a program asks you to pick a port, pick that entry:

WhereWhat you see
Browser port picker (Chrome, Edge)USB JTAG/serial debug unit
Linux/dev/ttyACM0, and /dev/serial/by-id/usb-Espressif_USB_JTAG_serial_debug_unit_…
macOS/dev/cu.usbmodem…
WindowsUSB Serial Device, as a COM port

On Linux the /dev/serial/by-id/… name ends in the board’s MAC address. It stays the same when other adapters are plugged in, unlike /dev/ttyACM0, so it’s the better one to save in a program’s settings.

To tell boards apart, connect and look at the node name or node ID, which JMRI lists for every node.

It carries LCC, not text

The port behaves as an LCC-USB adapter: it carries LCC traffic as GridConnect frames, like :X19170ABCN020157A7CD94;. Opened in a terminal, it shows those frames and nothing else, apart from a few lines from the chip’s bootloader right after a reset. The board’s text messages come out of the UART header at J1; see The console.

Programs that work with it:

  • JMRI. Add an LCC connection of type CAN via GridConnect and choose the port. The speed setting doesn’t matter.
  • System4Dispatch, the Uncommon Models dispatch panel. Choose USB serial (GridConnect) in Settings. The web app needs Chrome or Edge on a desktop computer; Firefox and Safari can’t open serial ports. The desktop app works in any case.

Only one program can have the port open at a time. If one program connects and another can’t, close the first, or put a hub such as rolcb-hub in front of the board and connect everything to the hub.

Without a CAN bus

A board used over USB or WiFi alone, with nothing plugged into its CAN port, works normally. Once it notices that nothing on the CAN side is taking its messages, it stops sending there. It is meant to start again as soon as a bus appears, but that hand-over hasn’t been tested yet.

Flashing

Firmware is built with ESP-IDF 5.2. The build steps are in the firmware README. In short, from software/openmrn:

make deps                          # once: fetch OpenMRN, check ESP-IDF
make build
make flash PORT=/dev/ttyACM0       # the USB-C port at P1

Flashing goes through the same USB port as LCC. Close JMRI, System4Dispatch or anything else holding the port first, or the flasher can’t open it.

Updating a board that is already set up

Some updates change how settings are stored. When a board starts on firmware like that, it resets every setting to its default: names, output uses, thresholds, events and WiFi. Write your settings down, or save them from JMRI, before updating. Event IDs come back the same, because they are derived from the board’s node ID. The current settings layout is version 0x0103, so a board running any earlier firmware resets when it is updated to the current one.