The University of Queensland Homepage
School of ITEE ITEE Main Website

 TCP/IP Networking

MicroBlaze uClinux Networking

One of uClinux' key strengths is its suite of networking protocols and applications.  This page describes how to get TCP/IP networking up and running on the default hardware target, mbvanilla_net. 

Please note this is NOT an in-depth tutorial on uClinux networking!  That is a deep subject - for information on setting up NFS, boa (webserver) and other networking applications, search the archives and ask around on either the MicroBlaze-uclinux or uclinux-dev mailing lists, and check out the FAQs at ucdot.org.

Preparation

  1. Make sure your uClinux sources are up to date and in synch with the uClinux CVS
     
  2. Download and apply any necessary patches
     
  3. Make sure you have the latest gcc toolchain

Hardware

Build the mbvanilla_net target.  You may need to modify this project slightly to support a board other than the Insight V2MB1000.  If you really must change the base address of the Xilinx EMAC peripheral, make a note of the new address, you'll need it later.

Kernel

Run "make menuconfig" from the uClinux-dist directory, and make the following selections:

  • Target Platform Selection
    • [*] Customize Kernel Settings
      • Processor type and features
        • [*] Ethernet driver
      • General Setup
        • [*] Networking support
      • Networking Options
        • [*] Unix domain sockets
        • [*] TCP/IP networking

        If you want NFS support:
         

      • Filesystems
        • Network File Systems
          • [*] NFS file system support
          • [*] Provide NFSv3 client support

        (exit and save)

If for any reason you modified the base address of the Xilinx ethernet MAC in your system.mhs, edit the file uClinux-dist/linux-2.4.x/include/asm-MicroBlaze/xparameters.h to reflect those changes.

Applications

Still within menuconfig, make the following selections.  These are optional, depending on what applications you want to run.  At a minimum, choose ping, inetd and telnetd.  This will allow you to demonstrate basic tcp/ip networking functionality.

  • [*] Customize Vendor/User Settings
    • Network Applications
      • [*] inetd
      • [*] ping
      • [*] portmap (if using NFS)
      • [*] telnetd
    • Busybox
      • [*] ifconfig
      • [*] ifconfig: status reporting
      • [*] ifconfig: enable hw option
      • [*] ifconfig: extra options
      • [*] mount
      • [*] mount: loop devices
      • [*] mount: support NFS mounts  (if using NFS)
      • [*] telnet (optional)
      • [*] tftp
      • [*] tftp: put
      • [*] tftp: get

        (exit and save)

Finally run "make dep; make clean; make"

The build should complete without errors.

Testing

After the build, your new image should be sitting in the uClinux-dist/images directory - as image.bin and image.elf.  Using xmd, download and run the kernel image.

When the kernel bootup completes, at the shell prompt enter the following:

/> hostname MicroBlaze1 (or whatever host name you wish)
/> ifconfig lo 127.0.0.1
/> ifconfig eth0 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx 

Get the ip, netmask and broadcast addresses from your network administrator.

Note that these commands can (should) be added to the vendors/.../rc script, so they are automatically executed on startup.

Then, try to ping yourself (press ^C after a few lines):

/> ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=10.0 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=10.0 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=10.0 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=10.0 ms

^C

--- 127.0.0.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.0/8.0/10.0 ms

Then, try to ping another machine on your local network (in this example I pinged my linux box, 130.102.66.250

/> ping 130.102.66.250
PING 130.102.66.250 (130.102.66.250): 56 data bytes
64 bytes from 130.102.66.250: icmp_seq=0 ttl=64 time=10.0 ms
64 bytes from 130.102.66.250: icmp_seq=1 ttl=64 time=0.0 ms
64 bytes from 130.102.66.250: icmp_seq=2 ttl=64 time=0.0 ms
64 bytes from 130.102.66.250: icmp_seq=3 ttl=64 time=0.0 ms
64 bytes from 130.102.66.250: icmp_seq=4 ttl=64 time=0.0 ms

^C

--- 130.102.66.250 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.0/2.0/10.0 ms

Finally, from a different machine on the network, try to telnet into your MicroBlaze (using whatever IP address you assigned in the "ifconfig" command above.

[jwilliam@g435-9029 jwilliam]$ telnet MicroBlaze1
Trying 130.102.64.34...
Connected to MicroBlaze1.
Escape character is '^]'.

MicroBlaze1 login: root
No directory, logging in with HOME=/
Welcome to
           ____ _ _
    _   _ / ___| (_)_ __ _ _ _ _
   | | | | |   | | | '_ \| | | < \/ >
   | |_| | |___| | | | | | |_| |> <
   | __,_|\____|_|_|_| |_|\__,_/_/\_>
   |_)

on MicroBlaze.

http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux


Sash command shell (version 1.1.1)
/>

Home Up


Last updated 08-May-2006   
© 2003-2006 John Williams unless otherwise stated