Skip to content

stm32f103 w5500 tcp server

mult TCP clients supported TCP server

WIZnet

Published February 17, 2023

Original author: donglicaiju76152Original source (new tab)

stm32f103 w5500 tcp server

Project description

DETAILS 背景 項目中需要使用網絡,開始使用的stm32f4+lwip的方案,但是硬件成本有些高,更主要的是lwip不好用,老是斷,可能是自己沒有研究透它吧。經過長時間的調研論證,最終選擇了w5500這款芯片。它把TCP/IP網絡協議棧固化在了硬件芯片中,爲用戶留出應用層接口,簡單穩定。 移植過程 首先,從https://w5500.com/上下載芯片手冊和參考代碼瞭解芯片的原理及基本用法,內容不是很複雜。項目中需要W5500作爲TCP Server,會有三個客戶端連接。參考相關代碼,移植到項目中,具體代碼如下。 配置 static void net_set_config(void) { unsigned char mac[6] = {0x00, 0x08, 0xdc, 0x11, 0x11, 0x11}; unsigned char ip[4] = {192, 168, 1, 100}; unsigned char sub[4] = {255, 255, 255, 0}; unsigned char gw[4] = {192, 168, 1, 1}; unsigned char tx_size[8] = {2,2,2,2,2,2,2,2}; unsigned char rx_size[8] = {2,2,2,2,2,2,2,2}; /* 設置Mac地址 */…

Keep reading with a free account

Guests can read 15 projects per visit. Log in or create a free account to read the full description, open the documents and join the comments.

Similar projects you might like