1 / 20

Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board

Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board. 蕭詣懋 SoC EE CCU 5/23/2005. 蕭詣懋 “93mowmow@vlsi.ee.ccu.edu.tw”. outline. Introduction Cyclone board ( platform introduction) lwIP Lan911c. introduction.

yuri
Download Presentation

Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Implementation LAN91c111-NE driver on Altera cyclone NIOS SoC development board 蕭詣懋 SoC EE CCU 5/23/2005 蕭詣懋“93mowmow@vlsi.ee.ccu.edu.tw”

  2. outline • Introduction • Cyclone board ( platform introduction) • lwIP • Lan911c

  3. introduction • Porting a open source TCP/IP stack (Lwip) on Altera Nios Cyclone development borad

  4. Our idea • Find a small TCP/IP for small device. The small TCP/IP named LWIP that is created by Adam Dunkels. • We hope that we can port LWIP to Nios and develop some sample programs for verifying it “Adam Dunkels” http://www.sics.se/~adam/

  5. LWIP feature lwIP is an implementation of the TCP/IP protocol stack. The focus of the lwIP stack is to reduce memory usage and code size, making lwIP suitable for use in small clients with very limited resources such as embedded systems. In order to reduce processing and memory demands,lwIP uses a tailor made API that does not require any data copying. This report describes the design and implementation of lwIP. The algorithms and data structures used both in the protocol implementations and in the sub systems such as the memory and buffer management systems are described. “lwip” http://savannah.nongnu.org/projects/lwip/

  6. lwIP

  7. Line of LWIP code

  8. Network interface - LWIP

  9. TCP Processing - LWIP

  10. Design flow • Find a workable lwIP version .make sure it can work on Linux on X86 PC. • Then write a Makefile which nios cross compiler can use. • Verify the lwIP TCP/IP stack can work on nios cyclone platform • Write the lan driver for lwIP • Trace connection between PC & cyclone

  11. UDP processing flow Simhost.c tcpecho.c udpecho.c Library Driver(Lan911c)

  12. Makefile of lwip • LIB4=liblwip4.a • Library • LIB=liblwip4unix.a • application

  13. liblwip4.a • IPV4=$(LWIPDIR)/core/ipv4/icmp.c.o $(LWIPDIR)/core/ipv4/ip.c.o $(LWIPDIR)/core/inet.c.o • CWFILES=$(LWIPDIR)/api/api_lib.c.o $(LWIPDIR)/api/api_msg.c.o $(LWIPDIR)/api/tcpip.c.o $(LWIPDIR)/api/err.c.o \ • # $(LWIPDIR)/netif/loopif.c.o $(LWIPDIR)/netif/tcpdump.c.o \

  14. liblwip4.a(con’t) • $(LWIPDIR)/netif/etharp.c.o \ • $(LWIPDIR)/netif/altera_avalon_lan91c111.c.o\ • $(LWIPDIR)/core/mem.c.o $(LWIPDIR)/core/memp.c.o $(LWIPDIR)/core/netif.c.o $(LWIPDIR)/core/pbuf.c.o \ • $(LWIPDIR)/core/stats.c.o $(LWIPDIR)/core/sys.c.o \ • $(LWIPDIR)/core/tcp.c.o $(LWIPDIR)/core/tcp_input.c.o \ • $(LWIPDIR)/core/tcp_output.c.o $(LWIPDIR)/core/udp.c.o

  15. liblwip4unix.a • ACFILES=$(wildcard $(LWIPDIR)/arch/unix/*.c $(LWIPDIR)/arch/unix/netif/*.c) \ • # ../../../../../../../altera/kits/nios/bin/nios-gnupro/newlib/libc/sys/arm/syscalls.c • # apps/fs.c apps/httpd.c \ • # apps/udpecho.c apps/tcpecho.c \ • # apps/shell.c

  16. demo Linux Cyclone A lwip program (tcp_receiver.c) A stander socket program ( tcp_sender.c )

  17. How to port lwIP to any platform • The general idea is that porting lwIP to new architectures requires only small changes to a few header files and a new sys_arch implementation • The sys_arch provides semaphores and mailboxes to lwIP.

  18. sys_arch • The following functions must be implemented by the sys_arch: • void sys_init(void) Is called to initialize the sys_arch layer. • sys_sem_t sys_sem_new(u8_t count) Creates and returns a new semaphore. The "count" argument specifies the initial state of the semaphore. • void sys_sem_free(sys_sem_t sem) Deallocates a semaphore.

  19. Get a lot of problem • Nios doesn’t support Pthread • The driver which I get is for lwIP 6.0.03, But the version I choose was lwIP 5.0.0.1 • still have a lot of bugs

  20. Conclusion • If you want to get ( learn ) something------just pay your time on it , sleep less ,trace code ,debug ,try and error .…And that is why we are here !! • System software is interesting and is more complicated • Especially, thanks very much to Mr.Pan for a lot of teaching.

More Related