Getting started with Linux on CM-X300

From Compulab Mediawiki
Revision as of 13:19, 18 August 2008 by Mike (talk | contribs) (New page: == Preparation steps == * Obtain a PC workstation with serial communication port. * Install TFTP server on host PC. For Windows machines we recommend [http://tftpd32.jounin.net/ TFTPD32] ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Preparation steps

  • Obtain a PC workstation with serial communication port.
  • Install TFTP server on host PC. For Windows machines we recommend TFTPD32 included in this distribution package.
  • Download the Linux distribution package for CM-X300 from CompuLab's website . Unzip the package to a directory on your host workstation.
  • All image files mentioned below can be found in images subdirectory
  • Make sure that Linux kernel binary image kernel.img, ramdisk image ramdisk.img and bootloader script image first_boot.img are accessible by the TFTP server.
    - On Windows machine: copy kernel.img, ramdisk.img and first_boot.img to the same folder and point the TFTP server to that folder
    - On Linux machine: copy kernel.img, ramdisk.img and first_boot.img to TFTP sevrver root directory, usually /tftpboot or /tftproot.
  • Copy debian-image.jffs2 and cm-x300-kernel.jffs2 from Linux distribution package for CM-X300 either to USB flash drive or to a directory exported through NFS.

Image installation

  • Connect CM-X300's ETH0 port to your local Ethernet
  • Connect the host PC to the CM-X300 via a null modem cable supplied with the Eval Kit.
  • Start terminal emulation software on your PC using the COM port to which the null modem is connected. Set baud rate to 38400 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
  • Turn on the CM-X300. The U-Boot will start and you will get a command prompt.
Admolition note.png If the boot settings of your CM-X300 are different than default, you may need to press and hold ^C while turning the CM-X300 on, in order to get command prompt.
  • The system will use DHCP to obtain IP address unless ipaddr and serverip environment variables are set
  • Use the following U-boot command to boot Linux on CM-X300:
> tftp 80400000 first_boot.img && autoscr 80400000
  • After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
  • Now you can install kernel and filesystem images to the NAND flash using USB flash drive or NFS share as described below.

Installation using USB flash drive

  • Connect USB flash drive to CM-X300. Use USB2 (host/slave) port.
  • The USB flash drive will be automatically mounted under /media/sda1
  • Format the NAND flash and write the kernel image and Debian filesystem image onto it:
$ flash_eraseall /dev/mtd4
$ flash_eraseall /dev/mtd5
$ nandwrite /dev/mtd4 /media/sda1/cm-x300-kernel.jffs2
$ nandwrite /dev/mtd5 /media/sda1/debian-image.jffs2

Installation using NFS

  • During boot the CM-X300 tries to obtain an IP address using DHCP. If you do not have DHCP server you can set the CM-X300 IP address statically using ifconfig:
$ ifconfig eth0 <ip address>
  • Mount the NFS share containing debian-image.jffs2 image:
$ mount <host ip>:/path/to/nfs/share /mnt/net
  • Format the NAND flash and write the kernel image and Debian filesystem image onto it:
$ flash_eraseall /dev/mtd4
$ flash_eraseall /dev/mtd5
$ nandwrite /dev/mtd4 /media/sda1/cm-x300-kernel.jffs2
$ nandwrite /dev/mtd5 /media/sda1/debian-image.jffs2