W55RP20-S2E Arduino Loopback Guide
This guide explains how to control the W55RP20-S2E module using a Raspberry Pi Pico and implement network loopback functionality.
How to Run Loopback Example
This project uses the Raspberry Pi Pico as the main controller to operate the W55RP20-S2E module. Connect to the W55RP20-S2E module via SPI or UART communication to implement TCP Client, TCP Server, and UDP Loopback functionality.
Supported Communication Methods:
- SPI Communication
- UART Communication
Supported Loopback Modes:
- TCP Client Loopback
- TCP Server Loopback
- UDP Loopback
Step 1: Prepare Software
Download and install the following software:
Required Software:
- Arduino IDE
- Tera Term - Serial terminal program
- Hercules - UDP/TCP test utility
Step 2: Arduino IDE Setup
Install Board Support Package
- Open Arduino IDE
- Go to File → Preferences
- Add the following to "Additional Boards Manager URLs": https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
- Go to Tools → Board → Boards Manager
- Search for "Raspberry Pi Pico" and install Raspberry Pi Pico/RP2040 by Earle F. Philhower, III
- Select Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico
Step 3: Hardware Connections
2.1 SPI Mode Connection
When controlling the W55RP20-S2E module via SPI, connect as follows:
| Raspberry Pi Pico | W55RP20-S2E Module | Description |
|---|---|---|
| GP4 (SPI0 RX/MISO) | GP3 (SPI_MISO) | Master In Slave Out |
| GP3 (SPI0 TX/MOSI) | GP4 (SPI_MOSI) | Master Out Slave In |
| GP2 (SPI0 SCK) | GP2 (SPI_SCK) | Clock Signal |
| GP5 (SPI0 CSn) | GP5 (SPI_CSn) | Chip Select |
| GP13 | GP13 (SPI_INT) | SPI Master Recv data pending pin |
| GP26 | GP26 (UART_SPI_SEL) | UART/SPI interface select pin (High:SPI, Low/NC:UART) |
| 3.3V | 3V3 | Power Supply |
| GND | GND | Ground |
2.2 UART Mode Connection
When controlling the W55RP20-S2E module via UART:
| Raspberry Pi Pico | W55RP20-S2E Module | Description |
|---|---|---|
| GP4 (UART1 TX) | GP5 (UART1 RX) | Pico TX → Module RX |
| GP5 (UART1 RX) | GP4 (UART1 TX) | Pico RX → Module TX |
| GND | GND | Ground |
| 3.3V | VCC/3V3 | Power Supply |
Step 4: Code Examples
Each example provides a .ino file to upload to the Pico.
Step 5: Upload and Test
4.1 Select Raspberry Pi Pico
- Go to Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico
- Select Tools → Port → Choose your COM port
4.2 Upload Code
- Open the desired example .ino file
- Modify IP addresses and port numbers as needed
- Click Upload button or press Ctrl+U
- Wait for upload to complete
4.3 Open Serial Monitor
- Go to Tools → Serial Monitor
- Set baud rate to 115200
- Verify network information and connection status
Step 5: Testing with Hercules
TCP Client Test
Hercules Server Setup:
// 이미지 첨부
- Launch Hercules
- Select TCP Server tab
- Port: 5000
- Click Listen
- Verify messages from Pico appear
- Type response message and click Send
Expected Results:
- Hercules receives "Hello from Pico + W55RP20..." message
- Serial Monitor displays Hercules response
TCP Server Test
Hercules Client Setup:
//이미지 첨부
- Launch Hercules
- Select TCP Client tab
- IP: 192.168.11.2 (Pico IP address)
- Port: 5000
- Click Connect
- Type message (e.g., "Test from Hercules")
- Click Send
Expected Results:
- Serial Monitor displays "Test from Hercules"
- Hercules receives echoed message
UDP Test
Hercules UDP Setup:
//이미지 첨부
- Launch Hercules
- Select UDP tab
- Module IP: 192.168.11.2
- Module Port: 5000
- Local Port: 5000 (or other available port)
- Type message (e.g., "UDP Test Message")
- Click Send
Expected Results:
- Serial Monitor displays "UDP Test Message"
- Hercules receives echoed packet

