Atmel AT02971: Use of Ethernet on SAM4E-EK
42134A-SAM4-05/2013
2
Table of Contents
1. Introduction .......................................................................................... 3
1.1 SAM4E Device Overview .................................................................................. 3
1.2 GMAC on SAM4E ............................................................................................. 4
2. Ethernet Networking La
yers ................................................................. 5
2.1 OSI Model ......................................................................................................... 5
2.2 Layer 1: Physical Layer ..................................................................................... 5
2.3 Layer 2: Data Link Layer ................................................................................... 5
2.4 Layer 3: Network Layer ..................................................................................... 6
2.5 Layer 4: Transport Layer ................................................................................... 6
2.6 Layer 7: Application Layer ................................................................................. 6
3. LwIP Stack Overview
........................................................................... 7
3.1 Protocols ........................................................................................................... 7
3.2 Application API Layers ...................................................................................... 7
3.2.1 Netconn API ........................................................................................ 8
3.2.2 Socket API .......................................................................................... 8
4. GMAC Stac
k Implementation on SAM4E............................................. 9
4.1 GMAC Stack File Organization ......................................................................... 9
4.2 GMAC Stack Data Structures ........................................................................... 9
4.2.1 gmac_rx_descriptor ............................................................................ 9
4.2.2 gmac_tx_descriptor .......................................................................... 11
4.2.3 gmac_options ................................................................................... 12
4.2.4 gmac_device ..................................................................................... 12
4.3 PHY Access Interfaces ................................................................................... 13
4.4 Ethernet Application Interfaces ....................................................................... 13
5. PHY I
mplementation .......................................................................... 14
5.1 KSZ8051MNL Introduction .............................................................................. 14
5.2 Initializing KSZ8051MNL ................................................................................. 14
6. GMAC De
mo on SAM4E-EK ............................................................. 15
6.1 GMAC Demo File Organization ....................................................................... 15
6.2 GMAC Demo Requirements ........................................................................... 16
6.3 LwIP Porting on SAM4E .................................................................................. 16
6.3.1 Initializing LwIP ................................................................................. 16
6.3.2 Configuring LwIP .............................................................................. 17
6.4 FreeRTOS Introduction ................................................................................... 17
6.5 Web Server Implementation ............................................................................ 18
6.6 TFTP Server Implementation .......................................................................... 19
6.7 Getting Started Using GMAC Demo ................................................................ 20
6.7.1 GMAC Demo Kit ............................................................................... 20
6.7.2 Tools for GMAC Demo Software ...................................................... 20
6.7.3 GMAC Demo Board Connections ..................................................... 21
6.7.4 Load GMAC Demo ........................................................................... 21
6.7.5 GMAC Demo Execution .................................................................... 21
7. Revision History
................................................................................. 23