Sunday, April 12, 2009

Setting Up The Development Environment

A part of the SheevaPlug Development Kit is the software development system. This system is used with a Linux Host system to develop applications for the SheevaPlug computer and is contained on a CD which comes with the computer. The CD contains several different files - most are compressed to conserve space (such as the SheevaPlug filesystem):

  1. README file for revision 1.1 of the SheevaPlug Development Kit. This is the first file you would want to view as it contains the instructions to setup the development system and has the descriptions as to the remaining files on the CD. This file also contains information in Appendix sections about different aspects of the development system and it's use in developing applications for the computer.

  2. Documentation Package: This package consists of the documents needed to bring up SheevaPlug development kit platform and SheevaPlug reference design guide.

  3. Schematics and Bill of Materials: This package provides the schematics, layout and BOM necessary to design SheevaPlug development kit reference boards.

  4. U-Boot: This package consists of the files and source codes needed to build U-Boot, initial bring-up of SheevaPlug development kit reference design as well as upgrading the

  5. Linux Support Package: This package provides the files and sources needed to build and configure the Linux kernel with Marvell’s LSP. It also includes a compiled uImage to bring-up SheevaPlug development kit reference design.

  6. File System: This package consists of Ubuntu’s jaunty filesystem.

  7. Host Software Support Package for Windows Host: This package consists of the mini-USB to USB driver that needs to be installed on the Windows host in order to access the debug console for SheevaPlug development kit. Windows does not come with the drivers required.

  8. Host Software Support Package for Linux Host: This package consists of the GCC cross-compiler that needs to be installed on the Linux Host. The package also consists of the basic root filesystem that needs to be installed on the Linux host to initially boot SheevaPlug development board using NFS.

For those of you who are Windows OS oriented only I suspect you will be put off from attempting to setup a software development system for the Plug Computer system - it is built using Linux only (at least at the time of this writing). I have read there is a move to have a Linux system called Ubuntu that is supposed to be able to run in a Windows environment but I have not verified this information yet.

N0w - I use Windows XP on my home development machine and find there are times I need Windows and times I need Linux. I am comfortable working with either, having cut my teeth on CP/M and Microsoft OS on a TRS-80 Model 1 (in other words I have been working with micro-computer systems since before Bill Gates got a speeding ticket in New Mexico!).

I use VMware to setup virtual machines on my home development machine - I find this to be a much better development environment as I can create new virtual machines as needed for different projects then save them for later use. It also makes "creating" a new development environment much simpler as all I have to do to create a new environment is copy an image of an existing VMware machine into a different directory then "import" the new copy into the VMware environment. With just a couple of trivial changes I have a new development environment to work in is a very short period of time. This is the method I used to create the development environment for the plug computer system under Ubuntu 8.04 Desktop. If there is enough interest I may configure a VMware image for doing development work on the SheevaPlug computer - then all you would need to do is download the free VMware Server and install the VMware machine image on your computer. Of course you would need enough resources on your machine to handle the environment (currently you would need at least 1-Gig of RAM and at least 200-Gigs of hard drive space as I create a "100-gig virtual hard drive for my images. I may be able to reduce the size but have not tested this yet). This would reduce development time as the packages would already be configured for you. Let me know if there is some interest in this.

The instructions for configuring a software development system in Linux is contained in the README file on the CD. The basic configuration looks something like this:

  1. Copy the rootfs.tar.bz2 package from ‘Host Software Support Package’ to your Linux host and extract all of its contents to a particular directory. This directory path will act as your rootpath for NFS boot of SheevaPlug development kit.

  2. Copy the LSP package contents to the same folder as above.

  3. Install the GCC cross compiler on the Linux host.

  4. Install the driver using the package ‘CDM 2.04.16_SHEEVA’ from ‘Host Software Support Package’ for the USB debug console on the Windows host.

  5. Follow the instructions in the Appendix A of ‘SheevaPlug - Writing Jaunty Filesystem on the NAND flash-Rev1.0.pdf’ document to flash the U-Boot from the U-Boot package.

  6. See Appendix C in ‘SheevaPlug - Writing Jaunty Filesystem on the NAND flash-rev1.0.pdf’ for boot from NFS.

  7. Follow the instructions of the ‘SheevaPlug - Writing Jaunty Filesystem on the NAND flash-Rev1.0.pdf’ document to flash the filesystem on the NAND of SheevaPlug development kit.

A little description of the above instructions may make things a little more clear as to what is actually being done. Most development kit instructions usually leave "something" to be desired in terms of actually what you are doing as opposed to what the writer assumes you are doing!

The first step above references copying the "rootfs.tar.bz2" package to your Linux host machine then extracting the contents to "a particular directory". The "particular directory" is really just a directory you create to contain the SheevaPlug root filesystem. This is being done to allow NFS (Network File System) access from the SheevaPlug computer system once you have the development system set up. The reason for this configuration is the ease of testing different applications on the SheevaPlug computer system without having to constantly re-writing the application software to the on-board Flash memory to test it.

The second step copies the content of the LSP file to the same directory - the LSP file contains the linux image that is used to run the SheevaPlug computer.

The first and second steps basically setup the linux host machine to allow booting up the SheevaPlug computer over the network using NFS and TFTP/BOOTP as the method to access the filesystem from the network.

Step three installs the GCC compiler needed to compile software for the SheevaPlug computer - this specific compiler is designed to compile software for the ARM computer core as opposed to the Intel i386 computer core. You have to compile applications code to run on the specific microprocessor core and this is what step three is all about.

Step four contains the instructions to install the USB driver needed to "talk" to the SheevaPlug computer through the USB console port. This software is installed on a Windows Host machine. This is one of the reasons I use a virtual machine setup for development work (grin).

Step five contains the instructions for writing the U-Boot image to the SheevaPlug on-board Flash memory. The U-Boot application starts the bootup process on the SheevaPlug machine.

Step six contains the instructions to configure the Flash memory for booting up the system through NFS.

Step seven contains the instructions on how to write the filesystem to the SheevaPlug Development system. This is needed so when you have the filesystem created with the applications you desire you can move it over to the SheevaPlug computer to allow stand-alone operation (IE: bootup directly on the machine instead of across NFS).

In a nutshell - the instructions listed above are the general instructions for development of application on the SheevaPlug computer. I am currently in the process of setting up the development system and will post any "oops" locations as I find them (grin).

No comments:

Post a Comment