finds.dev← search

// the find

armink/FreeModbus_Slave-Master-RTT-STM32

★ 1,942 · C · NOASSERTION · updated Dec 2022

Add master mode to FreeModbus. | 在 FreeModbus 中添加主机模式

A fork of FreeModbus that adds master mode, filling a real gap — the original FreeModbus only ships slave mode, and the official master implementation was commercial. Targets embedded C developers on STM32/RT-Thread who need a Modbus RTU master without paying for a license or rolling their own from scratch.

The master API mirrors the existing slave API style exactly, so the mental model transfer is low if you already know FreeModbus. Thread-safety is handled via a semaphore at the protocol stack level, so multi-threaded request callers don't have to coordinate externally. The blocking/non-blocking choice with configurable timeouts is the right call for RTOS environments where tasks may have different deadline requirements. BSD license, so it drops into commercial embedded products without GPL contamination.

Master mode is RTU-only — no ASCII, no TCP master, which is documented but still a real limitation if your network topology requires TCP. Slave addresses must be contiguous starting from 1, hardcoded assumption that will break silently if your network doesn't match. Last commit was 2022 and the bundled RT-Thread is 1.2.2 from circa 2013 — you're inheriting decade-old RTOS code if you use the included port. The reference platform is STM32F103 with IAR/MDK project files; porting to anything else means reading Chinese documentation and reverse-engineering the port layer by example.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →