Wiznet makers

Benjamin

Published November 18, 2025 ©

74 UCC

11 WCC

8 VAR

0 Contests

0 Followers

1 Following

Original Link

Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU.

Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU.

COMPONENTS Hardware components

WIZnet - W5500

x 1


STMicroelectronics - STM32F429I-DISC1

x 1


PROJECT DESCRIPTION

W5500 & STM32-Based Ethernet TCP Client–Server Implementation

This introduction covers the DevHeads IoT Community session titled “Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU.”  
The session demonstrates how to build a TCP server using an STM32 board and a W5500 Ethernet module, and how to communicate with it from a PC using a TCP client.  
The presenter, an embedded systems consultant with over ten years of experience, explains the W5500 architecture, SPI interfacing, IO library usage, TCP socket handling, and static IP setup through a practical, hands-on format.

DevHeads Channel Overview

DevHeads is a professional developer community focused on IoT solutions.  
The channel provides guides on firmware, PCB design, embedded systems, analog circuits, IoT trends, engineering interviews, live webinars, Q&A sessions, community project showcases, and technology updates.  
The community hosts challenges, hackathons, and interactive sessions for developers.

- Channel subscribers: 1,000  
- Total videos: 188  
- Total views: 57,153  
- Joined: August 13, 2023  
- Community: https://discord.gg/devheads  
- Instagram: https://instagram.com/devheads.io  
- Facebook: https://facebook.com/devheadsofficial  
- TikTok: https://tiktok.com/@devheads.io  
- X/Twitter: https://x.com/DevHeadsComm  
- LinkedIn: https://linkedin.com/company/97470436  

Video Details

- Title: Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU  
- Channel: DevHeads IoT Community  
- Streamed: 1 month ago (2025)  
- Views: 274  
- Tags: STM32, Ethernet, MCU  
- Link: https://www.youtube.com/watch?v=_19ZBA86IGc


Key Learning Points

 1) Building a TCP Server with STM32 and W5500

- STM32–W5500 connection using SPI Mode 0  
- Comparison of CS connection types (VDM / FDM)  
- Configuring a small static-IP network  
- Creating a TCP server using `wizchip_init` and `socket()` APIs  
- Auto-Negotiation demo when connecting/disconnecting the LAN cable  

W5500 Features

- Built-in TCP/IP stack  
- SPI interface (works even with 8-bit MCUs)  
- 10/100 Mbps with auto-negotiation  
- 32 KB internal memory (16 KB RX / 16 KB TX)

2) Live Demo – TCP Client–Server Operation

- STM32 + W5500 running as a TCP server  
- PC connects via Hercules TCP Client  
- Sending `"on"` → LED turns ON  
- Sending `"off"` → LED turns OFF  
- Server replies with status messages  
- LAN cable removal → “waiting for link…” printed  
- Reconnection → immediate link recovery  

This demo clearly shows W5500’s link detection and auto-negotiation behavior.

 3) IO Library Structure and Code Implementation

- Includes W5500-specific source files  
- `socket.c` provides TCP/UDP socket APIs  
- SPI Read/Write + CS control callback functions implemented  
- `wizchip_init` for chip setup  
- MAC, IP, subnet configuration  

The project is structured for STM32CubeIDE, making it easy to build and run.

4) Network Configuration

- PC IP: 192.168.2.2  
- Gateway: 192.168.2.1  
- W5500/STM32 IP: 192.168.2.99  
- Both devices must operate on the same subnet for TCP communication.

---

Example Code (GitHub)

- TCP Server Example  
 https://github.com/DevHeadsCommunity/tcpServer  

- Modbus TCP Server Example (next session)  
 https://github.com/DevHeadsCommunity/modbusTcpSlave  

---

 Video Information

- Title: Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU  
- Channel: DevHeads IoT Community  
- Streamed: October 3, 2025 / October 16, 2025  
- Link: https://www.youtube.com/watch?v=_19ZBA86IGc


 


 W5500 & STM32 기반 Ethernet TCP 클라이언트–서버 구현

DevHeads IoT Community에서 진행된  
“Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU” 실습 세션을 소개합니다.  
STM32 보드와 W5500 모듈을 이용해 TCP 서버를 구축하고, PC에서 직접 TCP 클라이언트로 접속하여 통신하는 전체 과정을 실습 중심으로 보여주는 콘텐츠입니다.  
발표자는 10년 이상의 경력을 가진 임베디드 시스템 컨설턴트로, W5500 구조, SPI 연결 방식, IO 라이브러리 활용, TCP 소켓 생성, 정적 IP 설정 등 이더넷 구현에 필요한 내용을 단계적으로 설명합니다.

 DevHeads 채널 소개

DevHeads는 IoT 중심의 개발자·엔지니어 커뮤니티입니다.  
펌웨어, 임베디드, PCB, 아날로그 설계, IoT 트렌드, 기술 인터뷰, 실시간 웨비나, Q&A, 커뮤니티 프로젝트 등 다양한 기술 콘텐츠를 제공합니다.  
또한 개발 챌린지·해커톤 등 커뮤니티 중심 활동도 활발합니다.

- 구독자: 1천 명  
- 전체 영상: 188개  
- 누적 조회수: 57,153회  
- 채널 개설: 2023년 8월 13일  
- Discord: https://discord.gg/devheads  
- Instagram: https://instagram.com/devheads.io  
- Facebook: https://facebook.com/devheadsofficial  
- TikTok: https://tiktok.com/@devheads.io  
- X/Twitter: https://x.com/DevHeadsComm  
- LinkedIn: https://linkedin.com/company/97470436 


주요 학습 내용

 1) W5500 기반 STM32 TCP Server 구현

- SPI Mode 0 기반 STM32–W5500 연결  
- CS(VDM/FDM) 두 가지 방식 비교  
- 정적 IP 기반 소규모 네트워크 구성  
- wizchip_init, socket() API를 통한 TCP Server 생성  
- LAN 케이블 연결/해제 시 자동 협상(Auto Negotiation) 확인  

W5500의 특징은 다음과 같습니다.

- TCP/IP 스택 내장  
- SPI 인터페이스 기반 (8bit MCU도 사용 가능)  
- 10/100Mbps 지원  
- 32KB 내장 메모리 (16KB RX / 16KB TX)

 2) Live Demo – TCP Client–Server 동작 과정

- STM32 + W5500 조합으로 TCP 서버 동작  
- PC의 Hercules TCP Client로 접속  
- "on" 메시지 → LED 켜짐  
- "off" 메시지 → LED 꺼짐  
- 서버 측에서 상태 메시지를 클라이언트로 회신  
- LAN 케이블 분리 시 “waiting for link…” 출력  
- 재연결 시 즉시 링크 복구  

실습 화면을 통해 W5500의 링크 감지 및 자동 협상 기능을 직접 확인할 수 있습니다.

 3) IO Library 구조 및 코드 구현

- W5500 전용 소스 파일 포함  
- socket.c 기반 TCP/UDP 소켓 API 제공  
- SPI Read/Write 및 CS 제어 콜백 함수 구현  
- wizchip_init으로 칩 초기화  
- MAC, IP, Subnet 등 네트워크 정보 설정  

CubeIDE 기반 프로젝트 형태로 제공되어  
직접 빌드하고 테스트하기에 적합합니다

 4) 네트워크 설정 방법

- PC IP: 192.168.2.2  
- Gateway: 192.168.2.1  
- W5500/STM32 IP: 192.168.2.99  
- 동일한 서브넷에서 TCP Client–Server 통신 수행  


 예제 코드 (GitHub)

- TCP Server 예제  
 https://github.com/DevHeadsCommunity/tcpServer  

- Modbus TCP Server 예제 (후속 세션 관련)  
 https://github.com/DevHeadsCommunity/modbusTcpSlave  


 영상 정보

- 제목: Ethernet Controller: Implement TCP Client–Server using W5500 & STM32 MCU  
- 채널: DevHeads IoT Community  
- 스트리밍: 2025년 10월 3일 / 2025년 10월 16일  

- 조회수: 274회  
- 태그: STM32, Ethernet, MCU  
- 링크: https://www.youtube.com/watch?v=_19ZBA86IGc


 

Documents
  • DevHeadsCommunity/TcpServer

  • DevHeads IoT Community Meetups

Comments Write