How to Build Ethernet Firmware with W5500 on STM32F103?
PP-W5500-STM32F103 is a compact Ethernet application board that combines an STM32F103 MCU with the WIZnet W5500 Ethernet controller.
How to Build Ethernet Firmware with W5500 on STM32F103?
Summary
PP-W5500-STM32F103 is a compact Ethernet application board that combines an STM32F103 MCU with the WIZnet W5500 Ethernet controller. The STM32F103 runs the embedded firmware and application logic, while the W5500 provides SPI-controlled hardware TCP/IP networking, socket handling, 10/100 Ethernet PHY operation, and internal TX/RX buffering. The board can also be used as a standalone W5500 module with another MCU, and it supports PoE module expansion for single-cable power and data designs.
What the Project Does
PP-W5500-STM32F103 is designed as a small Ethernet development and integration board for embedded applications. The product page describes it as a compact board for Ethernet applications and notes that PoE modules can be installed and used. It also supports a standalone mode where the W5500 can be connected directly to another MCU instead of relying only on the onboard STM32F103.
In a typical firmware project, the STM32F103 configures its SPI peripheral, resets the W5500, initializes W5500 socket buffer memory, sets network parameters, and then opens TCP or UDP sockets. Application data can come from UART, GPIO, ADC, I2C sensors, Modbus devices, or a local control loop. The W5500 handles the wired Ethernet transport and socket-level network behavior.
This makes the board useful for small industrial controllers, factory sensor gateways, serial-to-Ethernet prototypes, education labs, and embedded Ethernet bring-up. The same hardware can be evaluated in three ways: STM32F103 firmware plus W5500, W5500-only standalone connection to another MCU, or W5500 plus PoE expansion for wired power delivery.
Where WIZnet Fits
The WIZnet product used here is the W5500. It is the Ethernet controller on the PP-W5500-STM32F103 board.
The product listing identifies the Ethernet IC as W5500 and lists support for TCP, UDP, ICMP, IPv4, ARP, IGMP, and PPPoE. It also lists eight independent hardware sockets, 32 KB internal TX/RX buffer memory, SPI mode 0 and mode 3, embedded 10/100 Ethernet PHY, auto-negotiation, full/half duplex operation, built-in RJ45, 3.3 V output LDO, and status LEDs for link, activity, duplex, and speed.
For STM32F103 firmware, W5500 changes the networking boundary. The MCU does not need to run a full software TCP/IP stack just to send data to a server, host a small TCP service, or exchange UDP packets. Instead, the STM32F103 controls W5500 over SPI and operates hardware sockets. That is useful on an MCU class where RAM, Flash, interrupt load, and debugging time are limited.
The standalone W5500 mode is also important. If the onboard STM32F103 is not the final production MCU, the board can still be used as a W5500 Ethernet front end for another controller. That makes it practical for testing socket firmware, validating Ethernet wiring, or comparing MCU platforms before committing to a custom PCB.
The PoE expansion path adds a power architecture option. With a compatible PoE module installed, the Ethernet cable can carry both network data and power, which is useful for wall-mounted sensors, machine-side nodes, and compact industrial devices where separate DC wiring is inconvenient. The product page explicitly notes that PoE modules can be installed and used.
Implementation Notes
The source is a product page, not a firmware repository. No board-specific STM32F103 source code was provided on the accessible product page, so the following code is not copied from the manufacturer. It is a conceptual integration example based on WIZnet ioLibrary-style firmware.
Conceptual integration example based on WIZnet ioLibrary:
#include "wizchip_conf.h"
#include "socket.h"
static uint8_t tx_size[8] = {2,2,2,2,2,2,2,2};
static uint8_t rx_size[8] = {2,2,2,2,2,2,2,2};
void ethernet_init(void)
{
wizchip_init(tx_size, rx_size);
wiz_NetInfo netinfo = {
.mac = {0x00, 0x08, 0xDC, 0x10, 0x32, 0x01},
.ip = {192, 168, 10, 40},
.sn = {255, 255, 255, 0},
.gw = {192, 168, 10, 1},
.dns = {192, 168, 10, 1},
.dhcp = NETINFO_STATIC
};
wizchip_setnetinfo(&netinfo);
}This initialization step allocates W5500 socket buffer memory and writes the network identity used by the device. In STM32F103 firmware, the missing board-specific layer is the most important part: SPI initialization, chip-select control, reset timing, critical-section protection, and byte or burst read/write callbacks.
Conceptual integration example based on WIZnet ioLibrary:
#define SOCK_APP_TCP 0
#define LOCAL_PORT 5000
void tcp_server_poll(void)
{
switch (getSn_SR(SOCK_APP_TCP)) {
case SOCK_CLOSED:
socket(SOCK_APP_TCP, Sn_MR_TCP, LOCAL_PORT, 0);
listen(SOCK_APP_TCP);
break;
case SOCK_ESTABLISHED:
if (getSn_RX_RSR(SOCK_APP_TCP) > 0) {
uint8_t buf[128];
int32_t len = recv(SOCK_APP_TCP, buf, sizeof(buf));
if (len > 0) {
send(SOCK_APP_TCP, buf, len);
}
}
break;
case SOCK_CLOSE_WAIT:
disconnect(SOCK_APP_TCP);
break;
}
}This socket loop shows the practical W5500 firmware pattern. The STM32F103 checks the W5500 socket state, opens a TCP server when the socket is closed, accepts the established state, reads RX data, sends a response, and disconnects cleanly when the peer closes. It is small enough for education and bring-up, but it also reflects the same state-machine structure used in production embedded Ethernet firmware.
For standalone W5500 module usage, the MCU changes but the W5500 firmware model stays similar. The external MCU must provide SPI mode 0 or 3, chip-select, reset, interrupt if used, 3.3 V logic compatibility, and a clean ground reference. The same socket-level code can then be reused after the low-level SPI callbacks are ported.
For PoE expansion, firmware should not assume the network is ready immediately after power appears. A PoE-powered board may experience power classification, regulator startup, switch link negotiation, and server availability delays. The firmware should check PHY link state, retry socket creation, and avoid watchdog resets during link acquisition.
Practical Tips / Pitfalls
- Bring up SPI before sockets. Read a known W5500 register repeatedly before debugging TCP or UDP behavior.
- Keep chip-select timing strict. Address, control, and data phases must remain inside a valid W5500 SPI transaction.
- Use link status and socket status together. A disconnected cable, a closed socket, and an unreachable server are different failures.
- Decide early whether the board will use the onboard STM32F103 or standalone W5500 mode. The wiring, firmware ownership, and debug header strategy change.
- For PoE expansion, budget startup current and total load. Do not assume the PoE path can power every external sensor or actuator without checking the module rating.
- Keep industrial wiring practical: short SPI traces inside the enclosure, Ethernet magnetics/RJ45 placement away from noisy switching loads, and proper chassis or shield handling.
- Use DHCP for demos and static IP or DHCP reservation for deployed equipment. Maintenance teams need predictable addressing.
FAQ
Q: Why use W5500 with STM32F103 on this board?
A: W5500 provides hardware TCP/IP, Ethernet PHY operation, socket resources, and internal packet buffers. That lets the STM32F103 firmware control Ethernet through SPI without carrying the RAM and porting burden of a full software TCP/IP stack.
Q: How does W5500 connect to the STM32F103?
A: W5500 connects through SPI, using SCK, MOSI, MISO, chip-select, reset, power, and ground. The STM32F103 firmware must configure SPI mode 0 or 3, register W5500 read/write callbacks, and keep chip-select stable during each transaction.
Q: What role does W5500 play in this PP-W5500-STM32F103 design?
A: W5500 is the Ethernet transport and socket engine. The STM32F103 runs application firmware, sensor or I/O logic, and protocol framing, while W5500 handles TCP/UDP socket communication, Ethernet PHY behavior, and TX/RX buffering.
Q: Can beginners follow this board for Ethernet firmware learning?
A: Yes. It is suitable for learning STM32 SPI bring-up, static IP setup, TCP server/client loops, UDP packets, and socket-state debugging. Beginners should first verify SPI and link LEDs before testing application protocols.
Q: How does PP-W5500-STM32F103 compare with using a bare W5500 module?
A: A bare W5500 module is flexible but requires an external MCU, power design, wiring, and firmware bring-up from scratch. PP-W5500-STM32F103 gives a compact board with an onboard STM32F103 and W5500, while still allowing standalone W5500 usage with another MCU when the project needs a different controller.
Source
Original product page: PLATYPUS PP-W5500-STM32F103. The indexed product page identifies the board as a compact Ethernet application board with W5500, STM32F103, standalone W5500 usage, optional PoE module support, RJ45, 3.3 V LDO, and status LEDs.
Supporting source: PLATYPUS product index and resources page for product category context.
License: Not clearly stated on the product page.
Tags
#PPW5500STM32F103 #W5500 #WIZnet #STM32F103 #Ethernet #SPI #SocketProgramming #PoE #EmbeddedFirmware #IndustrialIoT #TCPIP #StandaloneW5500
STM32F103에서 W5500으로 Ethernet Firmware를 구현하는 방법은?
Summary
PP-W5500-STM32F103은 STM32F103 MCU와 WIZnet W5500 Ethernet controller를 결합한 compact Ethernet application board입니다. STM32F103은 embedded firmware와 application logic을 실행하고, W5500은 SPI로 제어되는 hardware TCP/IP networking, socket handling, 10/100 Ethernet PHY operation, internal TX/RX buffering을 제공합니다. 이 보드는 다른 MCU와 연결하는 standalone W5500 module로도 사용할 수 있으며, single-cable power/data 설계를 위한 PoE module expansion도 지원합니다.
What the Project Does
PP-W5500-STM32F103은 embedded application을 위한 소형 Ethernet development 및 integration board입니다. 제품 정보는 이 보드를 Ethernet application을 위한 compact board로 설명하며, PoE module을 장착해 사용할 수 있다고 안내합니다. 또한 onboard STM32F103만 사용하는 방식이 아니라, W5500을 다른 MCU에 직접 연결하는 standalone mode도 지원합니다.
일반적인 firmware project에서는 STM32F103이 SPI peripheral을 설정하고, W5500을 reset한 뒤, W5500 socket buffer memory를 초기화하고, network parameter를 설정한 다음 TCP 또는 UDP socket을 엽니다. Application data는 UART, GPIO, ADC, I2C sensor, Modbus device, local control loop 등에서 올 수 있습니다. W5500은 wired Ethernet transport와 socket-level network behavior를 담당합니다.
이 보드는 소형 industrial controller, factory sensor gateway, serial-to-Ethernet prototype, education lab, embedded Ethernet bring-up에 유용합니다. 같은 hardware를 세 가지 방식으로 평가할 수 있습니다. STM32F103 firmware와 W5500 조합, 다른 MCU에 연결하는 W5500-only standalone 구성, 또는 wired power delivery를 위한 W5500 plus PoE expansion 구성입니다.
Where WIZnet Fits
이 보드에서 사용되는 WIZnet 제품은 W5500입니다. PP-W5500-STM32F103 보드의 Ethernet controller 역할을 합니다.
제품 정보에 따르면 W5500은 TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE를 지원합니다. 또한 8개의 independent hardware sockets, 32 KB internal TX/RX buffer memory, SPI mode 0 및 mode 3, embedded 10/100 Ethernet PHY, auto-negotiation, full/half duplex operation, built-in RJ45, 3.3 V output LDO, link/activity/duplex/speed status LED를 제공합니다.
STM32F103 firmware에서 W5500은 networking boundary를 바꿉니다. MCU가 server로 데이터를 보내거나, 작은 TCP service를 열거나, UDP packet을 교환하기 위해 전체 software TCP/IP stack을 실행할 필요가 없습니다. 대신 STM32F103은 SPI로 W5500을 제어하고 hardware socket을 운용합니다. RAM, Flash, interrupt load, debugging time이 제한적인 MCU class에서 이 구조는 실용적입니다.
Standalone W5500 mode도 중요합니다. Onboard STM32F103이 최종 production MCU가 아니라면, 이 보드는 다른 controller를 위한 W5500 Ethernet front end로도 사용할 수 있습니다. Socket firmware test, Ethernet wiring validation, custom PCB 제작 전 MCU platform 비교에 유용합니다.
PoE expansion path는 power architecture option을 추가합니다. Compatible PoE module을 장착하면 Ethernet cable 하나로 network data와 power를 함께 전달할 수 있습니다. 별도 DC wiring이 불편한 wall-mounted sensor, machine-side node, compact industrial device에 적합합니다.
Implementation Notes
원본은 제품 페이지이며 firmware repository가 아닙니다. 접근 가능한 제품 페이지에는 board-specific STM32F103 source code가 제공되지 않았으므로 아래 코드는 제조사 코드에서 복사한 것이 아닙니다. WIZnet ioLibrary-style firmware를 기준으로 한 개념적 통합 예시입니다.
Conceptual integration example based on WIZnet ioLibrary:
#include "wizchip_conf.h"
#include "socket.h"
static uint8_t tx_size[8] = {2,2,2,2,2,2,2,2};
static uint8_t rx_size[8] = {2,2,2,2,2,2,2,2};
void ethernet_init(void)
{
wizchip_init(tx_size, rx_size);
wiz_NetInfo netinfo = {
.mac = {0x00, 0x08, 0xDC, 0x10, 0x32, 0x01},
.ip = {192, 168, 10, 40},
.sn = {255, 255, 255, 0},
.gw = {192, 168, 10, 1},
.dns = {192, 168, 10, 1},
.dhcp = NETINFO_STATIC
};
wizchip_setnetinfo(&netinfo);
}이 초기화 단계는 W5500 socket buffer memory를 할당하고, 장치가 사용할 network identity를 설정합니다. STM32F103 firmware에서는 이 코드보다 board-specific lower layer가 더 중요합니다. SPI initialization, chip-select control, reset timing, critical-section protection, byte 또는 burst read/write callback을 정확히 구현해야 합니다.
Conceptual integration example based on WIZnet ioLibrary:
#define SOCK_APP_TCP 0
#define LOCAL_PORT 5000
void tcp_server_poll(void)
{
switch (getSn_SR(SOCK_APP_TCP)) {
case SOCK_CLOSED:
socket(SOCK_APP_TCP, Sn_MR_TCP, LOCAL_PORT, 0);
listen(SOCK_APP_TCP);
break;
case SOCK_ESTABLISHED:
if (getSn_RX_RSR(SOCK_APP_TCP) > 0) {
uint8_t buf[128];
int32_t len = recv(SOCK_APP_TCP, buf, sizeof(buf));
if (len > 0) {
send(SOCK_APP_TCP, buf, len);
}
}
break;
case SOCK_CLOSE_WAIT:
disconnect(SOCK_APP_TCP);
break;
}
}이 socket loop는 실용적인 W5500 firmware pattern을 보여줍니다. STM32F103은 W5500 socket state를 확인하고, socket이 closed 상태이면 TCP server를 열고, established 상태에서는 RX data를 읽고 response를 보낸 뒤, peer가 연결을 닫으면 clean disconnect를 수행합니다. 교육과 bring-up에 충분히 단순하면서도, 실제 embedded Ethernet firmware에서 사용하는 state-machine 구조와 같습니다.
Standalone W5500 module로 사용할 경우 MCU는 바뀌지만 W5500 firmware model은 거의 동일합니다. 외부 MCU는 SPI mode 0 또는 3, chip-select, reset, 필요 시 interrupt, 3.3 V logic compatibility, 안정적인 ground reference를 제공해야 합니다. Low-level SPI callback만 포팅하면 같은 socket-level code를 재사용할 수 있습니다.
PoE expansion을 사용할 경우 firmware는 전원이 들어온 직후 network가 바로 준비되었다고 가정하면 안 됩니다. PoE-powered board에서는 power classification, regulator startup, switch link negotiation, server availability delay가 발생할 수 있습니다. Firmware는 PHY link state를 확인하고, socket creation을 retry하며, link acquisition 중 watchdog reset이 발생하지 않도록 설계해야 합니다.
Practical Tips / Pitfalls
- Socket보다 SPI bring-up을 먼저 해야 합니다. TCP나 UDP 동작을 디버깅하기 전에 W5500의 known register를 반복적으로 읽어야 합니다.
- Chip-select timing을 엄격하게 유지해야 합니다. Address, control, data phase는 유효한 W5500 SPI transaction 안에 있어야 합니다.
- Link status와 socket status를 함께 사용해야 합니다. Cable disconnected, socket closed, server unreachable은 서로 다른 failure입니다.
- Onboard STM32F103을 사용할지, standalone W5500 mode를 사용할지 초기에 결정해야 합니다. Wiring, firmware ownership, debug header strategy가 달라집니다.
- PoE expansion을 사용할 경우 startup current와 total load를 계산해야 합니다. PoE path가 모든 external sensor나 actuator를 자동으로 전원 공급할 수 있다고 가정하면 안 됩니다.
- 산업용 wiring은 현실적으로 설계해야 합니다. Enclosure 내부 SPI trace는 짧게 유지하고, Ethernet magnetics/RJ45 placement는 noisy switching load에서 떨어뜨리며, chassis 또는 shield 처리를 명확히 해야 합니다.
- Demo에는 DHCP를, deployed equipment에는 static IP 또는 DHCP reservation을 사용하는 것이 좋습니다. 유지보수팀에는 예측 가능한 addressing이 필요합니다.
FAQ
Q: 이 보드에서 STM32F103과 함께 W5500을 사용하는 이유는 무엇인가요?
A: W5500은 hardware TCP/IP, Ethernet PHY operation, socket resource, internal packet buffer를 제공합니다. STM32F103 firmware는 전체 software TCP/IP stack의 RAM 및 포팅 부담 없이 SPI로 Ethernet을 제어할 수 있습니다.
Q: W5500은 STM32F103에 어떻게 연결되나요?
A: W5500은 SPI로 연결되며 SCK, MOSI, MISO, chip-select, reset, power, ground를 사용합니다. STM32F103 firmware는 SPI mode 0 또는 3을 설정하고, W5500 read/write callback을 등록하며, 각 transaction 동안 chip-select를 안정적으로 유지해야 합니다.
Q: PP-W5500-STM32F103 설계에서 W5500은 어떤 역할을 하나요?
A: W5500은 Ethernet transport와 socket engine입니다. STM32F103은 application firmware, sensor 또는 I/O logic, protocol framing을 실행하고, W5500은 TCP/UDP socket communication, Ethernet PHY behavior, TX/RX buffering을 담당합니다.
Q: 초보자가 Ethernet firmware 학습용으로 이 보드를 사용할 수 있나요?
A: 가능합니다. STM32 SPI bring-up, static IP setup, TCP server/client loop, UDP packet, socket-state debugging을 학습하기에 적합합니다. 초보자는 application protocol을 테스트하기 전에 SPI와 link LED를 먼저 확인해야 합니다.
Q: PP-W5500-STM32F103은 bare W5500 module과 어떻게 다른가요?
A: Bare W5500 module은 유연하지만 external MCU, power design, wiring, firmware bring-up을 처음부터 준비해야 합니다. PP-W5500-STM32F103은 onboard STM32F103과 W5500을 갖춘 compact board이면서, 필요할 경우 다른 MCU와 standalone W5500 형태로도 사용할 수 있습니다.
Source
Original product page: PLATYPUS PP-W5500-STM32F103. Indexed product information identifies the board as a compact Ethernet application board with W5500, STM32F103, standalone W5500 usage, optional PoE module support, RJ45, 3.3 V LDO, and status LEDs.
Supporting source: PLATYPUS product index and resources page for product category context.
License: 제품 페이지에서 명확히 확인되지 않았습니다.
Tags
#PPW5500STM32F103 #W5500 #WIZnet #STM32F103 #Ethernet #SPI #SocketProgramming #PoE #EmbeddedFirmware #IndustrialIoT #TCPIP #StandaloneW5500
