---
title: "Modbus library for STM32 Microcontrollers"
url: "https://maker.wiznet.io/eric_g/projects/modbus-library-for-stm32-microcontrollers/"
markdown_url: "https://maker.wiznet.io/eric_g/projects/modbus-library-for-stm32-microcontrollers/md"
type: "UCC: User Created Content"
author: "Alejandro Mera"
author_url: "https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Alejandro Mera"
original_url: "https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS"
license: "GNU General Public License, version 3 or later (GPL3+)"
published: "2022-11-01"
language: "en"
likes: 6
views: 1312
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Modbus library for STM32 Microcontrollers

> CP, USART and USB-CDC Modbus RTU Master and Slave library for STM32 microcontrollers based on Cube HAL and FreeRTOS.

Original author: Alejandro Mera (source: https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS)

## Article

Includes multiple examples for popular development boards including BluePill, NUCLEO-64, NUCLEO-144 and Discovery Boards (Cortex-M3/M4/M7).

## **File structure**

```plaintext
├── LICENSE
├── README.md
├── Examples
    ├── ModbusBluepill --> STM32F103C8 USART Slave
    ├── ModbusBluepillUSB --> STM32F103C8 USART + USB-CDC Master and Slave 
    ├── ModbusF103 --> NUCLEO-F103RB Modbus Master and Slave
    ├── ModbusF429 --> NUCLEO-F429ZI Modbus Slave 
    ├── ModbusF429TCP --> NUCLEO-F429ZI Modbus TCP
    ├── ModbusF429DMA --> NUCLEO-F429ZI Modbus RTU DMA master and slave 
    ├── ModbusL152DMA --> NUCLEO-L152RE Modbus RTU DMA slave
    ├── ModbusH743 --> NUCLEO-H743ZI Modbus Slave
    ├── ModbusH743TCP --> NUCLEO-H743ZI Modbus TCP
    ├── ModbusF303 --> NUCLEO-F303RE Modbus Slavee
    ├── ModbusSTM32F4-discovery --> STM32F4-discovery TouchGFX + Modbus Master
├── MODBUS-LIB --> Library Folder
    ├── Inc
    │   └── Modbus.h 
    ├── Config
    │   └── ModbusConfigTemplate.h --> Configuration Template
    └── Src
        ├── Modbus.c 
        └── UARTCallback.c
```

Vide**o** demo for STM32F4-discovery board and TouchGFX: <https://youtu.be/XDCQvu0LirY>

---

Source: https://maker.wiznet.io/eric_g/projects/modbus-library-for-stm32-microcontrollers/
