Wiznet makers

viktor

Published August 19, 2024 ©

92 UCC

18 WCC

39 VAR

0 Contests

0 Followers

0 Following

Original Link

RP2040-W5100S-MM5D91


RP2040-W5100S-MM5D91

COMPONENTS Hardware components

WIZnet - W5100S

x 1


PROJECT DESCRIPTION

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

  • 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

  • Install the Raspberry PI Pico C++ SDK according to the official documentation
  • 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

PICO-SDK

Modbus TCP Server

Tiny-regex-c

Wiznet

Sensor software

  • License: LGPL 2.1
  • fully created byt Parcnu

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

  • unit tests found from tests folder
  • Reports of the tests in tests/Reports folder

ToDo

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

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.
Documents
Comments Write