Installation guide for Arcturus Networks Inc.'s uclinux release 1 Mount the ISO image or the CD to /mnt mount -o loop uclinux-dist-2008-feb-05-r0-release.iso /mnt 2 Install tool chains Go to the /mnt directory and run make. This will install all tool chains and uclinux dist source in /opt/. The following tool chains are installed. m68k uclinux in /opt/m68k uclinux, arm elf in /opt/uclinux and m68k elf in /opt/uclinux m68k elf. If m68k uclinux is not installed you can install it as mentioned in [1] or [2] below. [1] Install m68k uclinux tool chain from source Assume you have mounted your CD or ISO image in /mnt. You can find the source at /mnt/toolchains/src/freescale-coldfire-4.2-47-m68kuclinux.src.tar.bz2. Create a directory for building the tool chain, for example, mkdir ~/toolchain/. Then go to ~/toolchain/ and run tar xjf /mnt/toolchains/src/freescale-coldfire-4.2-47- m68k-uclinux.src.tar.bz2. You will have a freescale-coldfire-4.2-47-m68k-uclinux directory created. Then run freescale-coldfire-4.2-47-m68k-uclinux/build.sh. You'd better save the output from the build to a file so later you can look at any error it may occur. The building may fail due to missing packages on the host machine. The final binary tool chain is located at build/cf-uclinux-freescale/pkg/freescalecoldfire-4.2-47-m68k-uclinux-i686-pc-linux-gnu.tar.bz2. Follow [2] to install this tool chain. [2] Install prebuilt m68k uclinux tool chain You can find the prebuilt tool chain at /mnt/toolchains/freescale-coldfire-4.2-47- m68k-uclinux-i686-pc-linux-gnu.tar.bz2 or build/cf-uclinux-freescale/pkg/freescale-coldfire-4.2-47- m68k-uclinux-i686-pc-linux-gnu.tar.bz2 from [1]. You need to be a root user to install the tool chain. Here are the few steps you need to do. mkdir -p /opt/m68k-uclinux cd /opt/m68k-uclinux tar xjf /mnt/toolchains/freescale-coldfire-4.2-47-m68k-uclinux-i686-pc-linux-gnu.tar.bz2 3 Build an image for uc532x Add tool chain in the PATH export PATH=/opt/m68k-uclinux/bin:$PATH From top level of uclinux-dist-ani0806(make a copy from /opt), run "make Arcturus/uC532x_default". This will build an image when it finishes. You can find the final images in uclinux-dist-ani0806/images. You may get errors during the compilation so saving the output to a file is helpful. make Arcturus/uC532x_default &> dump.file And then search in the file(dump.file) for any errors. Here is an example of the error:
gcc -I/usr/include -I. -Dprintk=printf -DKERN_NOTICE= -DKERN_WARNING= -c -o build/compr_zlib.o compr_zlib.c compr_zlib.c:38:18: error: zlib.h: No such file or directory You need to install zlib header files in /usr/include to resolve this error. Another example: make[4]: flthdr: Command not found make[4]: [sh] Error 127 (ignored) You need to make a symbolic link for flthdr cd /opt/ m68k-uclinux/bin ; ln -sf m68k-uclinux-flthdr flthdr 4 Boot an image on uc53281 EVM module Connect to the module using "minicom /dev/ttys0" or whatever port you are using(ex. ttyusb0) and set the speed to 115200,8N1(no flow control, 8 bits, no parity bit, 1 stop bit). You should see "B$", otherwise press Esc while it boots(autoboot is enabled). There are two ways to upload an image: using rx or tftp. using rx Run "rx" in bootloader. Then press crtl + a + s and select xmodem. Choose the file (image.cramfs) to upload. You need to do this fast before it timeouts otherwise you will have to start it over again. using tftp Setup TFTP connection between the module and the host. By default the IP address for the bootloader TFTP server is 192.168.0.1. But you can change it using "setenv" command. B$ setenv IPADDR0 192.168.1.199 Suppose you want to program the image in partition 3. Let's take a look at the partition table. Command "part" will show the partition table. It should look like this: B$ part Partition BOOT on dev S29GL128N start: 0x00000000 end: 0x0001ffff RO Partition ENV on dev S29GL128N start: 0x00020000 end: 0x0003ffff RO Partition 0 on dev S29GL128N start: 0x00040000 end: 0x001bffff RW Partition * 1 on dev S29GL128N start: 0x001c0000 end: 0x005bffff RW Partition 2 on dev S29GL128N start: 0x005c0000 end: 0x005fffff RW Partition 3 on dev S29GL128N start: 0x00600000 end: 0x00ffffff RW If yours is different, you need setup a partition that is large enough so that it can hold image.cramfs and also should be on sector boundary. Partition is defined as environment variables with prefix _ followed by a number starting from 0. B$ printenv FACTORY=Arcturus Networks Inc. REVISION=M53281-EVM Rev 1.0 16MB Flash SERIAL=X474706DA-01D6F CONSOLE=ttyS0 HWADDR0=00:06:3B:00:AD:6F FW_VERSION=010908005
_0=40000:180000:RW _1=1c0000:400000:RW _2=5c0000:40000:RW _3=600000:a00000:RW CONSOLE_SPEED=115200 Suggest to set partitions this way: B$ setenv _0 40000 B$ setenv _1 1c0000 B$ setenv _2 5c0000 B$ setenv _3 600000 Where the second parameter given to setenv command is the starting address of that partition. The size of each partition will be calculated by part command for you. When running printenv before running part you will see the environment variables for _0, _1, _2 and _3: _0=40000 _1=1c0000 _2=5c0000 _3=600000 Then run part. It will recreate partitions and rewrite the environment variables automatically. Then run "tftp" B$ tftp uctftp Console 1.0 is running... From host run "tftp 192.168.1.199" or tftp 192.168.0.1 if you did not change the default IP address. Run it in binary mode and send the file image.cramfs to the module as below: $ tftp 192.168.1.199 tftp> bin tftp> put image.cramfs When uploading finishes, you will see "done" from the minicom output. You can break it by pressing "Esc" key. Now you will see "B$" again. Then do the following: (NOTE: you will lose the image in partition 3) B$ program 3: This will program the image into Flash at partition 3. Now change environment variable so the image just programmed can boot. B$ setenv KERNEL 3:linux.bin B$ setenv KERNEL_ARGS root=/dev/mtdblock3 This will change the old value 0:kernel.bin for KERNEL to new value 3:linux.bin which means to load the file linux.bin in partition 3. BTW, "0:kernel.bin" means file kernel.bin in partition 0. It is the time to boot the image. Just type "go" from "B$". B$ go To use uc52381 EVM default images change KERNEL back to "0:kernel.bin" and change
KERNEL_ARGS to "root=/dev/mtdblock1" B$ setenv KERNEL 0:kernel.bin B$ setenv KERNEL_ARGS root=/dev/mtdblock1 5 Build an image for uc53281 EVM If you have not added tool chain in the PATH do as follows: export PATH=/opt/m68k-uclinux/bin:$PATH From top level of uclinux-dist-ani0806, run "make Arcturus/uC53281-EVM_default". This will build an image when it finishes. You can find the final images in uclinux-dist- ANI0806/images. The successfully build should have following images: part0 000000.bin partition 0 cramfs image part1 000000.bin partition 1 cramfs image part2 000000.bin partition 2 cramfs image pmd50 000000.bin part0 000000.bin with a special header (ucheader) pmd51 000000.bin part1 000000.bin with ucheader pmd52 000000.bin part2 000000.bin with ucheader Where ucheader is a 256 bytes data which has a md5 check sum and is used by our WEB server's upload mechanism to validate the image before burning it into Flash. See user/boottools/ucbootstrap-tools/ucheader.h for details. You can use any methods in step 4 above to program part0 000000.bin, part1 000000.bin and part2 000000.bin. But you have to use WEB interface to program pmd50 000000.bin, pmd51 000000.bin and pmd52 000000.bin. Here is an example: A. On uc53281 EVM, at bootloader prompt "B$", type "tftp" and then hit "Enter" B$ tftp uctftp Console 1.0 is running... B. On your host run "tftp 192.168.0.1" then hit "Enter" (upload part0 000000.bin, part1 000000.bin and part2 000000.bin ) $ tftp 192.168.0.1 tftp> bin tftp> put part0-000000.bin (when no error occurs that means you successfully upload the image part0 000000.bin) C. On uc53281 EVM you will notice:... done D. On uc53281 EVM hit "Esc" to break the tftp mode. "B$" sign is back. Then run "program 0:" B$ program 0: erase... done write... done B$
E. repeat A D for part1 000000.bin and part2 000000.bin. Note that for part1 000000.bin you need to run "program 1:" on uc53281 EVM and for part2 000000.bin you need to run "program 2:". F. When all 3 images are programmed then type "go" from the bootloader prompt "B$". You may notice that it automatically updates the bootloader then reboot. Now you will have a working system.