Advanced MicroBlaze uClinux NetworkingIf you have configured TCP/IP networking on your board, you can really start to speed your development processes. This page describes a few techniques that I use every day. Networked Kernel UpdatesWaiting for a kernel and filesystem image to load over the serial port (via XMD) is very painful. The image update can be sped up dramatically, through the use of tftp (trivial FTP). First, you need to configure your development machine as a tftp server. Security Warning! tftp is an insecure protocol. You should only deploy it on a secure network (i.e. inside a firewall). Please speak to your local network administrator before proceeding. Configuring your host as a tftp serverPlease refer to these instructions for configuring your host as a tftp server. You should test to ensure that the server is working properly before proceeding. The remainder of this document assumes that you have used the /tftpboot directory as your tftp server root. If not, adjust accordingly. uClinux Configuration SettingsIn the menu configuration -> vendor/user config, ensure the following are enabled
Edit the vendors Makefile for your platform (e.g. for mbvanilla_net, the file is uClinux-dist/vendors/Insight/mbvanilla_net/Makefile) At the end of the "image:" target, ensure there is a line similar to:
This simply copies the final image file into the tftp server root. Once these changes are complete, perform the usual make dep, make sequence to build the new image. Confirm that the file image.bin has been copied into the /tftpboot directory on your host. Networked image updatesThis is what it's all about - no more serial downloads: Boot uClinux with the new kernel and filesystem image. Erase the flash partition that holds the image:
Now grab the new kernel image via tftp:
substituting the IP address of your development host as appropriate. A brief explanation of the parameters to the tftp application:
This should complete without errors - you now have a new kernel image stored in the flash. Simply reboot the board (I press the "program" button to reconfigure the FPGA), the bootloader will start, choose to boot from Flash Slot 1, and off you go! No more waiting for kernel uploads via the serial port! Speeding application developmentIf you are working on developing a new application for uClinux, it can be very slow to rebuild the kernel/filesystem image and upload it every time you make a small change. Here's a simple way to improve the situation:
When you make changes to your application (say uClinux-dist/user/my-app), do a "make user_only" from the uClinux-dist directory to rebuild just the applications. Then, on the uClinux board, simply cd into /mnt/user/my-app, and run the newly rebuilt program:
The magic of Linux networking and virtual filesystems means that your new application code will be pulled over the network and executed, just as though it were stored on a local filesystem! You can streamline things a bit further: Add the line
to the uClinux rc script (e.g. uClinux-dist/vendors/Insight/mbvanilla_net/rc and create a file vendors/.../.../fstab containing something like
that is copied into the uClinux filesystem. There is already an example of this in the vendors/mbvanilla_net/ directory. Now, when uClinux boots you can simply type "mount /mnt" to mount the filesystem. |
|
