test.html
We have measured TCP throughput of W7500 depending on RX buffer size, Main bus clock and DMA and
used HW, SW and Toos as belows,
What is SoC with TCP/IP TOE, W7500

The 7500 chip is the one-chip solution which integrates an ARM Cortex-M0, 128KB Flash and hardwired TCP/IP TOE which is a market-proven hardwired TCP/IP stack with an integrated Ethernet. Using TOE allows users to implement the Ethernet application by adding the simple socket program. It’s faster and easier than using any other Embedded Ethernet solutions, especially internet of things. In addition, TOE can provide high and stable network performance on target system.

Traditional system could be used operation system for TCP/IP stack. It means more memory and calcurate resources in IoT system which is limited resources extremely. TOE allows to offload the processing of TCP/IP protocols from the host microcontroller,
In TCP/IP protocol stack of W7500, there are multiple protocols as like,
- Supports Hardwired TCP/IP Protocols : TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE
- Supports 8 independent sockets simultaneously
- Supports Power down mode
- Supports Wake on LAN over UDP
Hardware
- W7500, SoC with TOE, for IOT
- ARM Cortex-M0
- Hardwired TCP/IP Core
- 8 Sockets
- SRAM for socket: 32 KB
- Memories
- Flash: 128 KB
- Large flexible-size SRAM buffer for various User Application
- ROM for boot code: 6 KB
- ADC : 12bit, 8ch, 1Msps
- 6-channel DMA
- GPIOs
- Timer/PWM : 1 Watchdog , 4 Timers, 8 PWMs
- Communication Interfaces: 3 UARTs, 2 SPIs, 2 I2Cs
- Crypto : 1 RNG (Random Number Generator)
- Package : 64 TQFP (7x7 mm)
- WIZwiki_W7500

- WIZnet W7500
- 32-bit ARM Cortex-M0
- 128KB Flash / 48 SRAM
- Hardware TCP/IP coe (WIZnet TCP/IP Engine)
- CMSIS-DAP
- SWD Con.
- WIZwiki-W7500 feature
- Arduino Pin compatible
- ISP / SD Slot / REG LED
- Ethernet PHY
Software: TCP recv only
- How to config. Clock
- How to config. RX memory buffer
- Iperf test Firmware
- Source Code : https://github.com/embeddist/W7500/tree/W7500_DMA
- W7500/W7500x_Library_Examples/Projects/Peripheral_Examples/WZTOE/IperfTest_DMA/main.c
- TCP only Recv function in iperf.c
int32_t recvonly_tcps(uint8_t sn, uint8_t* buf, uint16_t port)
{
int32_t ret;
uint16_t size = 0;
int32_t i;
switch(getSn_SR(sn))
{
case SOCK_ESTABLISHED :
if(getSn_IR(sn) & Sn_IR_CON)
{
setSn_IR(sn,Sn_IR_CON);
}
if((size = getSn_RX_RSR(sn)) > 0)
{
if(size > DATA_BUF_SIZE) size = DATA_BUF_SIZE;
printf("---------------size :%d\r\n", size);
ret = recv(sn, buf, size);
}
break;
case SOCK_CLOSE_WAIT :
if( (ret = listen(sn)) != SOCK_OK) return ret;
break;
case SOCK_CLOSED:
if((ret = socket(sn, Sn_MR_TCP, port, Sn_MR_ND)) != sn) return ret;
break;
default:
break;
}
return 1;
}
- Sn_RXBUF_SIZE (Socket n RX Buffer Size Register)
Sn_RXBUF_SIZE configures the RX Buffer size of Socket n. Socket n RX Buffer size can be configured with 1,2,4,8, and 16 Kbytes. If a different size is configured, the data cannot be normally received from a peer.
Value (dec) |
0 |
1 |
2 |
4 |
8 |
16 |
Buffer size |
0KB |
1KB |
2KB |
4KB |
8KB |
16KB |
- Use wizchip_init() for Setting Sn_RXBUF_SIZE
uint8_t tx_size[8] = { 8, 0, 0, 0, 0, 0, 0, 0 };
uint8_t rx_size[8] = { 8, 0, 0, 0, 0, 0, 0, 0 };
...
wizchip_init(tx_size, rx_size);
- Use API for Setting Sn_RXBUF_SIZE
uint8 socket_num = 0;
uint8 rx_buffer_size = 4;
setSn_RXBUF_SIZE(socket_num, rx_buffer_size);
- How to use Direct Memory Access (DMA)
Direct memory access (DMA) is used in order to provide high-speed data transfer between peripherals and memory as well as memory to memory. The DMA controller has up to 6 channels in total, each dedicated to managing memory access requests from one or more peripherals. For more details, refer to “PrimeCell® μDMA Controller (PL230)” from the Technical Reference Manual.
• WZ_TOE-to-memory transfer (software request only)
- Initialization by using API
dma_data_struct_init();
dma_init();
- DMA memory copy in W7500x_dma.c
uint32_t chnl_num = 5 ;
unsigned int src = 0xXXXX_XXXX;
unsigned int dest = 0xDDDD_DDDD ;
unsigned int size = 0;
unsigned int num = 1024;
void dma_memory_copy (chnl_num, src, dest, size, num)
- Read/Write DMA functions for WZ_TOE
#define _DEF_ACCESS_DMA_BUF_
#ifdef _DEF_ACCESS_DMA_BUF_
#include "W7500x_dma.h"
#define MAX_TRANSNUM 1024
void WIZCHIP_READ_DMA (uint32_t BaseAddr, uint16_t ptr, uint8_t* pBuf, uint16_t len)
{
}
void WIZCHIP_WRITE_DMA(uint32_t BaseAddr, uint16_t ptr, uint8_t* pBuf, uint16_t len)
{
}
...
Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
- https://iperf.fr/
# ex.) host IP(192.168.77.9):port[5000], display format is Mbit/sec, interval 1 sec.
>iperf.exe -c 192.168.77.9 -p 5000 -f m -i 1
- -c : —client host, -c will connect to the host specified.
- -p : —port #, the server port for the server to listen.
- -f : —format [], ‘m’ = Mbit/sec
- -i : —interval #, Sets the interval time in seconds between periodic bandwidth through performance
- Serial terminal for wizwiki_W7500 monitoring
PHY is linked.
MAC ADDRESS : 00:08:DC:01:02:03
IP ADDRESS : 192.168.077.009
GW ADDRESS : 192.168.077.001
SN MASK: 255.255.255.000
TEST- START
0:Listen, TCP server loopback, port [5000]
0:Connected - 192.168.77.223 : 1110
- Excute Iperp on Command Prompt
Analysis of this improvement shows
- that the total improvement is due to increasing RX buffer.
- that the total improvement is due to increasing AHB bus Clock.
- that 200% of the total improvement is due to using DMA.
- Fig. TOE performance according to RX buffer size ( w/o DMA@48MHz)
- Fig. TOE performance according to to RX buffer size (w/ DMA@20MHz)
- Fig. TOE performance according to AHB bus clock (w/o DMA, RX Buffer:8KB)
- Fig. TOE performance according to AHB bus clock (w/o DMA, RX Buffer:8KB)