---
title: "RP2040-W5100S-MM5D91"
url: "https://maker.wiznet.io/viktor/projects/rp2040-w5100s-mm5d91/"
markdown_url: "https://maker.wiznet.io/viktor/projects/rp2040-w5100s-mm5d91/md"
type: "UCC: User Created Content"
author: "parcnu"
author_url: "https://github.com/parcnu/RP2040-W5100S-MM5D91"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "parcnu"
original_url: "https://github.com/parcnu/RP2040-W5100S-MM5D91"
published: "2024-08-19"
language: "en"
hardware: ["WIZnet W5100S"]
likes: 0
views: 762
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# RP2040-W5100S-MM5D91

> RP2040-W5100S-MM5D91

Original author: parcnu (source: https://github.com/parcnu/RP2040-W5100S-MM5D91)

## Components

- **WIZnet W5100S** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5100S))

## Article

## Sensor:

<https://github.com/parcnu/RP2040-W5100S-MM5D91#sensor>

- Modbus TCP Slave/Server library for RP2040 + Wiznet 5100S based on the C++ SDK and FreeRTOS

- can be ported to W5100S-EVB-Pico, requires EEPROM and Accelerometer to be added in I2C-bus.

- sensorSW handling Sensor side UART.

- FreeRTOS in own folder as submodule

- tiny regex also as submodule

- sensorSW contains Sensor side UART.

- Protoocol contains Modbus side.

- main.cpp in own folder

- wiznet w5100s sdk in wiznet folder

### Environment

<https://github.com/parcnu/RP2040-W5100S-MM5D91#environment>

- Raspberry Pi 4/Ububntu 22.04 /Osx /Windows as development environment.

- Updating the SW through SWD enabling also the debugging.

- See installation instructions below.

### How to use

<https://github.com/parcnu/RP2040-W5100S-MM5D91#how-to-use>

- Install the Raspberry PI Pico C++ SDK according to the official [documentation](https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf)

- Configure the environment to work with Visual Studio Code

- Clone this repository and initialize the submodules

```
git clone https://github.com/jasa66/TrueSense.git
cd Modbus-PI-Pico-FreeRTOS
git submodule update --init --recursive
cd ../tiny-regex-c
git submodule update --init --recursive
```

- Open the repository folder in Visual Studio Code

- update the [launch.json](/Modbus-PI-Pico-FreeRTOS/blob/main/.vscode/launch.json) file according to your environment.

- Start the debugging session according to the official documentation

## FreeRTOS

<https://github.com/parcnu/RP2040-W5100S-MM5D91#freertos>

- port of FreeRTOS to the Raspberry Pi Pico published at: <https://github.com/FreeRTOS/FreeRTOS-Kernel.git>

- (<https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/main/portable/ThirdParty/GCC/RP2040>)

- FreeRTOS TAG 11.0.1 (includes SMB)

- License MIT

- <https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/LICENSE.md>

## PICO-SDK

<https://github.com/parcnu/RP2040-W5100S-MM5D91#pico-sdk>

- Pico sdk version 1.5.1

- (<https://github.com/raspberrypi/pico-sdk>)

- License BSD-3 Clause

- <https://github.com/raspberrypi/pico-sdk/blob/master/LICENSE.TXT>

## Modbus TCP Server

<https://github.com/parcnu/RP2040-W5100S-MM5D91#modbus-tcp-server>

- ModbusTCP in Protocol folder

- License LGPL-2.1, ported to TCP and W5100S from <https://github.com/alejoseb/Modbus-PI-Pico-FreeRTOS>

## Tiny-regex-c

<https://github.com/parcnu/RP2040-W5100S-MM5D91#tiny-regex-c>

- Regular expression functions for embedded use: <https://github.com/kokke/tiny-regex-c>

- License: free, no restrictions.

- <https://github.com/kokke/tiny-regex-c/blob/master/LICENSE>

## Wiznet

<https://github.com/parcnu/RP2040-W5100S-MM5D91#wiznet>

- Wiznet W5100S SDK

- <https://github.com/Wiznet/ioLibrary_Driver>

- License MIT: <https://github.com/Wiznet/ioLibrary_Driver/blob/master/license.txt>

## Sensor software

<https://github.com/parcnu/RP2040-W5100S-MM5D91#sensor-software>

- License: LGPL 2.1

- fully created byt Parcnu

## Compiling environment

<https://github.com/parcnu/RP2040-W5100S-MM5D91#compiling-environment>

- Requires environment variables
  - SENSOR_PATH to point to folder where main CmakeList.txt is located
  - FREERTOS_KERNEL_PATH to point to folder where FreeRTOS-Kernel is located.
  - PICO_SDK_PATH to point pico sdk location.

- GCC arm-none-eabi-gcc (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009

- GDB GNU gdb GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1

- CMAKE cmake version 3.28.3

## Testing

<https://github.com/parcnu/RP2040-W5100S-MM5D91#testing>

- unit tests found from tests folder

- Reports of the tests in tests/Reports folder

## ToDo

<https://github.com/parcnu/RP2040-W5100S-MM5D91#todo>

- split main to main and initialization files. Main too big and confusing.

## Known issues

<https://github.com/parcnu/RP2040-W5100S-MM5D91#known-issues>

- FreeRtos SMB has issue in Assert debugs. Local fix created. Should be removed with later FreeRTOS versions.

- sleep_ms do not work as expected in Pico SDK 1.4.0 FreeRTOS SMB version. Created Sleep_ms to get over the issue.

---

Source: https://maker.wiznet.io/viktor/projects/rp2040-w5100s-mm5d91/
