// the find
cwalter-at/freemodbus
BSD licensed MODBUS RTU/ASCII and TCP slave
FreeModbus is a Modbus RTU/ASCII/TCP implementation for embedded systems, targeting microcontrollers like AT91SAM, STM32, and similar ARM chips. It's a BSD-licensed protocol stack that's been the go-to reference implementation for embedded Modbus for over a decade. If you need Modbus slave/server support on bare metal or FreeRTOS, this is where most people still land.
The core protocol stack (modbus/ directory) is BSD licensed — you can ship it in a commercial product without open-sourcing anything. The port abstraction is clean: you implement five functions (serial init, timer, event queue, critical section) and the protocol layer works unchanged across targets. There are concrete working demos for a wide range of MCUs (ADUC7xxx, AT91SAM3S, STM32, AVR, Win32) that show exactly what a port looks like. The Modbus TCP and RTU/ASCII implementations are in the same codebase and share the same application callback API, so switching transport doesn't require rewriting your register handlers.
The project is effectively unmaintained — the README openly admits the original author is gone and the community-merge approach means master may have regressions; if you need stability, you're pinned to 1.6.0 forever. It only implements the slave/server role, so if you need a Modbus master you're on your own or looking at a different library. No Modbus TCP client security (no TLS, no authentication) which matters if you're putting this anywhere near a network rather than a local RS-485 bus. The demo directory is a mess of vendored FreeRTOS snapshots — you get multiple stale copies of FreeRTOS 7.x embedded in the tree, which means the code you actually want to read is buried under hundreds of unrelated driver files.