Wiznet makers

gunn

Published February 06, 2026 ©

68 UCC

0 VAR

0 Contests

0 Followers

0 Following

Original Link

Teensy 4.1 - W5500 using SPI DMA

Teensy 4.1 - W5500 using SPI DMA

COMPONENTS Hardware components

WIZnet - W5500

x 1


PROJECT DESCRIPTION

This discussion is a technical discussion on optimization methods to increase throughput of the W5500 Ethernet chip on the Teensy 4.1 board.

The main points are summarized in three key points:

1. Problem: Lower-than-expected throughput
The user (istrateandrei26) is concerned that while the Teensy 4.1's native Ethernet achieves 90 Mbps, the SPI-connected W5500 is stuck at 16 Mbps.

Based on the experience of achieving 43 Mbps on the lower-performance Nucleo board, he wonders if the lack of SPI DMA (Direct Memory Access) is the reason for the slowdown on the Teensy 4.1.

2. Expert Advice (Paul Stoffregen): Library Optimization
Paul, Teensy developer, points out that the efficiency of the software library is more important than simply the presence of hardware acceleration (DMA).

The Teensy-specific Ethernet.h library already includes middleware-level optimizations, such as low-level SPI optimizations and socket state caching, and is recommended as potentially faster than the standard Wiznet ioLibrary.

Due to the hardware characteristics of the W5500, which vary in data transfer phases, some are skeptical that DMA will necessarily guarantee a 2-3x performance improvement.

3. Changing the Discussion: DMA vs. CPU Overhead
The user cites an example of DMA speed improvements on another device (STM32) and continues to question whether DMA will be effective in reducing "dead time" between SPI communications in Teensy 4.1.

In conclusion, the debate centers on "whether library optimizations that reduce unnecessary communications and DMA are actually efficient, rather than simply increasing the SPI clock."

=========================

이 대화는 Teensy 4.1 보드에서 W5500 이더넷 칩의 데이터 전송 속도(throughput)를 높이기 위한 최적화 방법에 대한 기술적인 토론입니다.

주요 내용을 3가지 핵심 포인트로 요약해 드립니다.

1. 문제 상황: 기대보다 낮은 전송 속도
사용자(istrateandrei26)는 Teensy 4.1의 네이티브 이더넷은 90 Mbps가 나오지만, SPI로 연결한 W5500은 16 Mbps에 머물고 있어 고민 중입니다.

성능이 더 낮은 Nucleo 보드에서도 43 Mbps가 나왔다는 사례를 근거로, Teensy 4.1에서 속도가 안 나오는 이유가 SPI DMA(Direct Memory Access) 부재 때문인지 궁금해합니다.

2. 전문가(Paul Stoffregen)의 조언: 라이브러리 최적화
Teensy의 개발자인 Paul은 단순히 하드웨어 가속(DMA)의 유무보다 소프트웨어 라이브러리의 효율성이 더 중요하다고 지적합니다.

Teensy 전용 Ethernet.h 라이브러리는 이미 저수준 SPI 최적화와 소켓 상태 캐싱 등 미들웨어 수준의 최적화가 되어 있어, 일반적인 Wiznet ioLibrary보다 빠를 수 있다고 추천합니다.

W5500의 하드웨어 특성상 데이터 전송 단계가 가변적이라 DMA가 반드시 성능 향상(2~3배)을 보장하지는 않을 것이라는 회의적인 시각을 보입니다.

3. 논점의 전환: DMA vs CPU 오버헤드
사용자는 타 기기(STM32)에서 DMA를 통해 속도가 향상된 사례를 제시하며, Teensy 4.1에서도 SPI 통신 사이의 '데드 타임(Dead Time)'을 줄이는 데 DMA가 효과가 있을지 질문을 이어갑니다.

결론적으로 "단순히 SPI 클럭을 높이는 것보다, 불필요한 통신을 줄이는 라이브러리 최적화와 DMA가 실제 효율이 있는지"에 대한 공방이 대화의 핵심입니다.

 

W5500 의 역할과 사용 이유

W5500의 역할: W5500은 이더넷 컨트롤러로, SPI 인터페이스를 통해 호스트 프로세서(Teensy 4.1)와 통신하며 네트워크 연결을 담당하는 하드웨어 칩입니다.

사용 이유: 사용자는 Teensy 4.1 보드에서 두 개의 이더넷 인터페이스를 구현하기 위해 W5500을 사용했습니다. Teensy 4.1은 기본적으로 하나의 기본 이더넷 포트를 가질 수 있지만, 추가적인 이더넷 통신 채널이 필요했기 때문에 외장 칩인 W5500을 추가하여 확장하려 한 것입니다.

해당 대화에서는 특히 데이터 처리 효율을 높이기 위해 SPI 통신 시 DMA(Direct Memory Access) 기술을 W5500과 함께 구현하는 것에 대해 논의하고 있습니다.

시사점

Hybrid 뿐 아니고 하나의 보드에서 여러개의 Ethernet 을 사용하는 고객들도 늘고 있다.

 

FAQ

Q) 왜 Ethernet 이 추가로 필요했지요? 왜 Ethernet 이 2개 필요했지요?

A) 기능 요구가 ‘2개의 물리 이더넷 포트’라서 W5500을 추가한 겁니다.

Ethernet을 2개 쓴 이유는 Teensy 4.1을 “2포트 이더넷 장치(브리지/라우터/게이트웨이/인라인 분석기 등)”로 만들기 위해서이고, 내장 포트가 1개뿐이라 두 번째 물리 포트를 W5500(SPI Ethernet)으로 추가한 것입니다.

Documents
Comments Write