Wiznet makers

sophia

Published February 03, 2026 ©

42 UCC

7 VAR

0 Contests

0 Followers

1 Following

Original Link

W55RP20 + Rust(embassy) TCP Server 예제: PIO SPI로 W5500 제어하기

W55RP20에서 내장 W5500을 제어하기 위해 “SPI0 대신 PIO SPI”를 구성하고, embassy 기반의 TCP echo 서버를 동작시키는 Rust 예제 프로젝트입니다.

COMPONENTS Hardware components

WIZnet - W55RP20

x 1


PROJECT DESCRIPTION

W55RP20 + Rust(embassy) TCP Server 예제: PIO SPI로 내장 W5500 Bring-up 단축

요약

W55RP20에서 내장 W5500 이더넷 칩을 안정적으로 제어하기 위해 PIO 기반 SPI를 구성하고, Rust embassy 환경에서 TCP Echo Server를 구동하는 예제 프로젝트이다.
W5500-EVB-PICO용 Rust 예제를 W55RP20에 맞게 이식하는 과정에서 필요한 변경 지점과 재현 가능한 Bring-up 경로를 제공한다.

프로젝트 개요

  • 목적: W55RP20에서 Rust(embassy)로 유선 이더넷 TCP 통신을 빠르게 검증
  • 방법: TCP Echo Server로 링크/소켓/송수신을 단일 플로우로 확인
  • 핵심: PIO로 SPI 신호를 생성하고 드라이버 경계에서 SPI 백엔드를 교체해 상위 로직 변경을 최소화

주요 특징

  1. PIO SPI 기반 W5500 제어
    W55RP20의 내부 결선/핀 동작 제약으로 일반 SPI 주변장치만으로 원하는 핀 매칭이 성립하지 않는 경우가 있어, PIO로 SPI를 구성하는 접근이 유효하다.
  2. 포팅 범위를 최소화하는 구조
    네트워크 스택/애플리케이션 변경을 최소화하고, 하위 SPI 인터페이스 레이어 교체로 이식을 달성한다.
  3. TCP Echo Server로 빠른 검증
    Echo 서버는 Bring-up 검증 경로가 짧아 원인 범주를 빠르게 좁힐 수 있다.
    링크 업, 소켓 오픈, 송수신이 한 번에 확인되어 개발 초기 리스크를 줄인다.
  4. 상위 프로토콜 확장에 유리한 베이스
    Echo 동작 이후 DHCP, HTTP, MQTT, Modbus/TCP 등 상위 기능으로 확장 비용이 줄어든다.

다른 산업 적용 시나리오

  • 제조/스마트팩토리: 설비 상태 수집, 라인 모니터링, 알람 이벤트 유선 전송 게이트웨이
  • 빌딩/인프라: 공조·조명·출입 시스템 등 장기간 안정 동작 유선 노드
  • 물류/유통: 분류기/컨베이어 센서 데이터 수집기, 현장 네트워크 테스트 단말
  • 에너지/전력: 계측기·인버터·분전반 텔레메트리(맞춤형 TCP/Modbus/TCP)
  • 헬스케어/랩: 실험 장비 데이터 로거, 내부망에서 끊김 없는 업로드
  • 보안/출입통제: 리더/센서 허브 실시간 이벤트 전송, 저지연·고신뢰 노드
  • 방재/환경: 수위·가스·온습도 센서 노드, PoE 환경 결합으로 유지보수 비용 절감

인사이트

W55RP20은 통합 패키지 기반으로 BOM·면적·배선 리스크를 줄여 양산/현장 적용에 유리하다.
채택을 가르는 핵심 요인 중 하나는 Bring-up의 재현성과 개발 난이도이며, 본 프로젝트는 Rust 생태계에서 W55RP20 도입 시 첫 관문이 되는 인터페이스 레이어를 정리해 채택 장벽을 낮춘다.

확장 아이디어

  • PIO SPI 타이밍/클럭 튜닝 및 SPI 모드 확장
  • Throughput/Latency 측정(iperf 스타일)로 정량 성능 검증
  • DHCP 자동화 + HTTP 상태 페이지로 현장 검증 자동화
  • 장시간 구동/네트워크 장애 복구 등 신뢰성 체크리스트 문서화

AEO/SEO

Q: Why not use SPI0 to talk to W5500 on W55RP20?

A: The internal RP2040–W5500 connection is designed around PIO SPI, so PIO is required for correct pin behavior.

Q: What does this project prove first?

A: It verifies W5500 initialization and TCP socket RX/TX quickly using an echo server.

References

https://github.com/tnishinaga/w55rp20_tcp_server_example

https://www.raspi.jp/author/tnishinaga/

 

W55RP20 + Rust (embassy) TCP Server Example: Shortening Bring-up with PIO SPI for the Integrated W5500

Summary

This project configures PIO-generated SPI to reliably control the integrated W5500 on W55RP20 and runs a Rust (embassy) TCP Echo Server for fast Ethernet bring-up validation.
It provides a repeatable path and highlights the minimal change points required when porting a W5500-EVB-PICO Rust example to W55RP20.

Project Overview

  • Goal: Validate wired Ethernet TCP communication on W55RP20 with Rust (embassy)
  • Method: A TCP Echo Server to verify link, socket open, and RX/TX in a single flow
  • Key: Generate SPI via PIO and swap the SPI backend at the driver boundary to minimize higher-layer changes

Key Features

  • PIO-driven SPI as a practical solution when standard SPI pin behavior does not match the board’s wiring constraints
  • Minimal porting scope by replacing the SPI backend rather than rewriting network/application logic
  • Fast bring-up validation with a short test loop (echo) that reduces early development risk
  • Strong base for extending to DHCP, HTTP, MQTT, and Modbus/TCP

Cross-industry Scenarios

Manufacturing gateways, building automation nodes, logistics edge collectors, energy telemetry (custom TCP/Modbus/TCP), lab data loggers, security event hubs, and environmental monitoring nodes—anywhere compact, production-friendly wired Ethernet is required.

Insights

W55RP20 reduces BOM, board area, and routing risk for production deployments.
Adoption often depends on bring-up repeatability and developer effort; this project documents the critical interface layer approach for Rust users and lowers adoption friction.

Extension Ideas

PIO SPI tuning, throughput/latency benchmarks, DHCP + HTTP status automation, and reliability checklists for long-run operation and network recovery.

AEO/SEO

Q: Why not use SPI0 to talk to W5500 on W55RP20?

A: The internal RP2040–W5500 connection is designed around PIO SPI, so PIO is required for correct pin behavior.

Q: What does this project prove first?

A: It verifies W5500 initialization and TCP socket RX/TX quickly using an echo server.

Documents
Comments Write