Difference between revisions of "CM-X270: Linux: Getting started"

From Compulab Mediawiki
Jump to: navigation, search
 
(Preparation Steps)
 
Line 7: Line 7:
 
* Obtain a PC workstation with serial communication port.
 
* Obtain a PC workstation with serial communication port.
 
* Install TFTP server on host PC. For Windows machines we recommend [http://tftpd32.jounin.net/ TFTPD32] included in this distribution package.
 
* Install TFTP server on host PC. For Windows machines we recommend [http://tftpd32.jounin.net/ TFTPD32] included in this distribution package.
* Download the [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip Linux distribution package for CM-X270] from CompuLab's website . Unzip the package to a folder on your host workstation.
+
* Download the [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-img.zip Linux distribution package for CM-X270] from CompuLab's website . Unzip the package to a folder on your host workstation.
* Download the [http://www.compulab.co.il/x270cm/download/x270-linux-drv.zip Linux kernel package for CM-X270] from CompuLab's website. Unzip the package to a folder on your host workstation.
+
* Download the [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-drv.zip Linux kernel package for CM-X270] from CompuLab's website. Unzip the package to a folder on your host workstation.
* Make sure that Linux kernel binary image {{filename|zImage.2.6.24}} from [http://www.compulab.co.il/x270cm/download/x270-linux-drv.zip Linux kernel package for CM-X270] and ramdisk image {{filename|ramdisk.gz}} from [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip Linux distribution package for CM-X270] are accessible by the TFTP server.  
+
* Make sure that Linux kernel binary image {{filename|zImage.2.6.24}} from [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-drv.zip Linux kernel package for CM-X270] and ramdisk image {{filename|ramdisk.gz}} from [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-img.zip Linux distribution package for CM-X270] are accessible by the TFTP server.  
 
*: - On Windows machine: copy {{filename|zImage.2.6.24}} and {{filename|ramdisk.gz}} to the same folder and point the TFTP server to that folder
 
*: - On Windows machine: copy {{filename|zImage.2.6.24}} and {{filename|ramdisk.gz}} to the same folder and point the TFTP server to that folder
 
*: - On Linux machine: copy {{filename|zImage.2.6.24}} and {{filename|ramdisk.gz}} to TFTP sevrver root directory, usually {{filename|/tftpboot}} or {{filename|/tftproot}}.
 
*: - On Linux machine: copy {{filename|zImage.2.6.24}} and {{filename|ramdisk.gz}} to TFTP sevrver root directory, usually {{filename|/tftpboot}} or {{filename|/tftproot}}.
* Copy {{filename|debian-image.jffs2}} from [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip Linux distribution package for CM-X270] either to USB flash drive or to a directory exported through NFS.
+
* Copy {{filename|debian-image.jffs2}} from [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-img.zip Linux distribution package for CM-X270] either to USB flash drive or to a directory exported through NFS.
  
 
=== Image installation ===
 
=== Image installation ===
Line 66: Line 66:
  
 
# Obtain a PC workstation with serial communications port.
 
# Obtain a PC workstation with serial communications port.
# Download the [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip Linux distribution package for CM-X270] from CompuLab's website. Unzip the package to a folder on your workstation PC. Within the package, unzip {{filename|1=disk.dat.zip}} file, to extract {{filename|1=disk.dat}}.
+
# Download the [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-img.zip Linux distribution package for CM-X270] from CompuLab's website. Unzip the package to a folder on your workstation PC. Within the package, unzip {{filename|1=disk.dat.zip}} file, to extract {{filename|1=disk.dat}}.
# Download the [http://www.compulab.co.il/x270cm/download/x270-linux-drv.zip Linux kernel package for CM-X270] from CompuLab's website. Copy the file named {{filename|1=zImage.2.x.x}} from the package to the same folder. If installing on CM-X255, download the kernel specific for X255, since kernels are different per architecture.
+
# Download the [http://compulab.co.il/wp-content/uploads/2011/09/x270-linux-drv.zip Linux kernel package for CM-X270] from CompuLab's website. Copy the file named {{filename|1=zImage.2.x.x}} from the package to the same folder. If installing on CM-X255, download the kernel specific for X255, since kernels are different per architecture.
 
# From the X270 kernel package, select version 2.6.16. Drivers in the file system image are kernel version dependent to some extent. If you prefer to use a different version of kernel, you will have to resolve the dependencies yourself. (Note for X255 users: older kernels were also tested)
 
# From the X270 kernel package, select version 2.6.16. Drivers in the file system image are kernel version dependent to some extent. If you prefer to use a different version of kernel, you will have to resolve the dependencies yourself. (Note for X255 users: older kernels were also tested)
 
# Rename the kernel file from {{filename|1=zImage.2.x.x}} to {{filename|1=zImage}} - to remove version marking.
 
# Rename the kernel file from {{filename|1=zImage.2.x.x}} to {{filename|1=zImage}} - to remove version marking.

Latest revision as of 15:30, 19 August 2012

Image Installation

Starting from version 0.6 of Debian Linux package for CM-X270, the filesystem image is distributed in standard Linux JFFS2 format. The image can be loaded into the CM-X270 from Linux only. For convenience of the installation we provide small ramdisk image with all the necessary utilities. Alternatively, you can use a USB flash drive or NFS share as initial root filesystem for image installation.

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-X270 from CompuLab's website . Unzip the package to a folder on your host workstation.
  • Download the Linux kernel package for CM-X270 from CompuLab's website. Unzip the package to a folder on your host workstation.
  • Make sure that Linux kernel binary image zImage.2.6.24 from Linux kernel package for CM-X270 and ramdisk image ramdisk.gz from Linux distribution package for CM-X270 are accessible by the TFTP server.
    - On Windows machine: copy zImage.2.6.24 and ramdisk.gz to the same folder and point the TFTP server to that folder
    - On Linux machine: copy zImage.2.6.24 and ramdisk.gz to TFTP sevrver root directory, usually /tftpboot or /tftproot.
  • Copy debian-image.jffs2 from Linux distribution package for CM-X270 either to USB flash drive or to a directory exported through NFS.

Image installation

  • Connect CM-X270's ETH0 port to your local Ethernet
  • Connect the host PC to the CM-X270 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-X270. The ARMmonitor will start and you will get a command prompt.
Admolition note.png If the boot settings of your CM-X270 are different than default, you may need to press and hold ^C while turning the CM-X270 on, in order to get command prompt.
  • If you are installing the image using USB flash drive use usb3mode ARMmonitor command to set USB3 port to host mode.
  • Use setip ARMMON command to turn on the DHCP support or set static IP for your system. You can review the current IP setup by typing setupinfo. Perform the necessary setup, save and reset the board.
  • Use the following ARMON command sequence to boot Linux on CM-X270:
> download kernel tftp "zImage.2.6.24" <host ip>
> flash kernel
> download ramdisk tftp ramdisk.gz <host ip>
> bootos "root=/dev/ram0 console=ttySA0,38400"
  • After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
  • Now you can install filesystem image 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-X270. Use USB3 (host/slave) port available in all CM-X270 configurations.
Admolition note.png If you use SB-X270 rev 1.3 make sure you have a jumper assembled on pins 10-11 of P15.
  • The USB flash drive will be automatically mounted under /media/sda1
  • Format the NAND flash and write the Debian filesystem image onto it:
$ flash_eraseall /dev/mtd3
$ nandwrite /dev/mtd3 /media/sda1/debian-image.jffs2

Installation using NFS

  • During boot the CM-X270 tries to obtain an IP address using DHCP. If you do not have DHCP server you can set the CM-X270 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 Debian filesystem image onto it:
$ flash_eraseall /dev/mtd3
$ nandwrite /dev/mtd3 /mnt/net/debian-image.jffs2

Legacy image installation

This section describes installation of images conformant with Compulab proprietary NAND flash format

Preparation Steps

  1. Obtain a PC workstation with serial communications port.
  2. Download the Linux distribution package for CM-X270 from CompuLab's website. Unzip the package to a folder on your workstation PC. Within the package, unzip disk.dat.zip file, to extract disk.dat.
  3. Download the Linux kernel package for CM-X270 from CompuLab's website. Copy the file named zImage.2.x.x from the package to the same folder. If installing on CM-X255, download the kernel specific for X255, since kernels are different per architecture.
  4. From the X270 kernel package, select version 2.6.16. Drivers in the file system image are kernel version dependent to some extent. If you prefer to use a different version of kernel, you will have to resolve the dependencies yourself. (Note for X255 users: older kernels were also tested)
  5. Rename the kernel file from zImage.2.x.x to zImage - to remove version marking.
  6. On CM-X270: ensure that you have ARMmon running
  7. Connect the host PC to the CM-X270 via a null modem cable supplied with the Eval Kit.
  8. Choose the method of installation as explained in the next section.

Installation

Installation using LAN

This installation process requires local network with optional DHCP server. Host computer can run Windows or Linux. This method enables highest data rate and fastest turnover if repeated installations are required. Please refer to setip command in ARMmon manual for instruction on how to turn on the DHCP support or set static IP for your system. You can review the current IP setup by typing setupinfo. Perform the necessary setup, save and reset the board.

Installing the kernel
  1. Connect CM-X270's ETH0 port to your local Ethernet
  2. Install TFTP server on host PC. The TFTP server tested by CompuLab is TFTPD32 included in this distribution package.
  3. Point the TFTP server to the folder that contains Linux installation files for CM-X270: zImage and disk.dat
  4. 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.
  5. Turn on the CM-X270. The ARMmonitor will start and you will get a command prompt.
  6. Note: If the boot settings of your CM-X270 are different than default, you may need to press and hold ^C while turning the CM-X270 on, in order to get command prompt.
  7. In terminal window, type:
    > download kernel tftp zImage <ip of your host PC>
    The Linux kernel will be transferred from host PC to CM-X270's memory (SDRAM) through LAN, using TFTP protocol. (ARMMON contains TFTP client)
  8. In terminal window type:
    > flash kernel
    The Linux kernel will be saved to the NOR flash.
Installing the filesystem
  1. Format the NAND Flash, by typing in terminal window:
    > nand flash format
    This will erase the NAND flash contents!
    Are you sure(y/n)?
    y
    
  2. Type:
    > nand write disk.dat <ip of your host PC>
    
  3. This will start downloading the NAND flash image from the tftp server directly to NAND flash. Wait for the process to end.

  4. Follow to After Installation section below.

Installation using USB link

This method requiring minimum user's actions and it is fast enough. It uses USB slave port of CM-X270 and requires host workstation running Windows 2000 or XP.

Installation process
  1. Download the UsbMlink from [Developer] >> [CM-X270] >> [UsbMlink]. Read UsbMLink documentation provided in its package. Following documentation install and activate UsbMLink.
  2. If ARMmon of your card dated August 16, 2006 or later, run nor_prefix utility, provided with this package. It adds a 4 byte file length prefix to kernel image, required by new bootloader. (Note: use nor_prefix only for installation by UsbMlink). For help run nor_prefix without arguments.
  3. Rename the zImage (kernel image) file to nor-data.in. Using UsbMLink_GUI perform [NOR Update].
  4. Rename the disk.dat (filesystem image) file to nand-data.in. Using UsbMLink_GUI perform [NAND Update]. It will take about 15 minutes.
  5. Disconnect USB from target and follow to After Installation section below.

After Installation

  1. Reset the CM-X270.
  2. To start Linux type:
    > bootos
  3. If you want Linux to start automatically, type:
    > setboot os 
    > save
    > bootos
    

If you want to get back to ARMmon prompt, hold Ctrl-C during reset.

Connection and Logging In

Use the following usernames and passwords to login:

Account with administrative privileges:

User: root
Password: 111111

Regular user account:

User: user
Password: 111111

In addition to these accounts CM-X270 allows anonymous FTP access.

To login into the Linux system, you may use a serial console at 38400 bps (ttySA0 for Linux 2.6.16 and ttyS0 for previous Linux versions), or connect through the network, or use a keyboard and VGA display (tty1, tty2, tty3).

See also