CM-A510: Linux: Getting started

From Compulab Mediawiki
Jump to: navigation, search

Preparation steps

Admolition note.png It is possible to install Linux on CM-A510 using either an NFS share, USB flash drive or a SATA hard drive. The NFS method is recommended because NFS setup will ease further Linux evaluation and development.
  • Obtain a PC workstation with serial communication port.
  • For installation using NFS install TFTP server on host PC. For Windows machines we recommend TFTPD32 included in this distribution package.
  • Download the Linux distribution package for CM-A510 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
  • Copy debian-image.ubi and kernel.img from Linux distribution package for CM-A510 either to a directory exported through NFS or to a USB flash drive.

Image installation

  • Connect the host PC to the CM-A510 via the serial cable supplied with the CM-A510 evaluation kit.
  • Start terminal emulation software on your PC using the COM port to which the serial cable is connected. Set baud rate to 115200 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
  • Turn on the CM-A510. The U-Boot boot-loader will start and you will get a command prompt.
Admolition note.png If the boot settings of your CM-A510 are different than default, you may need to press and hold ^C while turning on the CM-A510, in order to get command prompt.

Installation using NFS

  • Connect CM-A510 LAN0 Ethernet port (connector P11 on SB-A510) to your local Ethernet
  • Make sure that Linux kernel binary image kernel.img, ramdisk image ramdisk.img and bootloader script image bootscr.img are accessible by the TFTP server.
    - On Windows machine: copy kernel.img, ramdisk.img and bootscr.img to the same folder and point the TFTP server to that folder
    - On Linux machine: copy kernel.img, ramdisk.img and bootscr.img to TFTP sevrver root directory, usually /tftpboot or /tftproot.
  • You can use U-boot dhcp command to obtain IP address or manually set the ipaddr environment variable:
> setenv ipaddr <CM-A510 ip address>
  • Set the serverip environment variable and save the new environment to NAND flash:
> setenv serverip <host ip address>
> saveenv
  • Use the following U-boot command to boot Linux on CM-A510:
> tftp 100000 bootscr.img && autoscr 100000
  • During Ramdisk image booting the CM-A510 attempts to obtain an IP address using DHCP. If from some reason the IP address has not been obtained, use the following commands to obtain IP address for the CM-A510:
    • Obtain IP using DHCP:
      $  ifup eth0
    • If you do not have a DHCP server, you can set a static IP address using ifconfig:
      $  ifconfig eth0 <ip address>
  • After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
  • Mount the NFS share containing kernel.img and debian-image.ubi image:
$ mount -o nolock <host ip>:/path/to/nfs/share /mnt/net
  • Format the NAND flash kernel partition and write the kernel image onto it:
$ flash_erase /dev/mtd0 0 0
$ nandwrite -p /dev/mtd0 /mnt/net/kernel.img
  • Format the NAND flash root filesystem partition and write Debian filesystem image onto it:
$ ubiformat -O 2048 /dev/mtd1 -f /mnt/net/debian-image.ubi

Installation using USB flash drive

  • Make sure that CM-A510 LAN0 Ethernet port (connector P11 on SB-A510) is disconnected
  • Make sure that Linux kernel binary image kernel.img, ramdisk image ramdisk.img, Debian filesystem UBI image debian-image.ubi and bootloader script image bootscr.img are present at the root directory of the USB flash drive.
  • Connect USB flash drive formated with FAT file system to SB-A510. Use USB1 port (the lower USB connector of P11 on SB-A510).
  • Use the following U-boot command to boot Linux on CM-A510:
> usb start
> fatload usb 0:1 100000 bootscr.img
> autoscr 100000
  • After the ramdisk image is loaded you will get Linux login prompt. Login as root into the system.
  • The USB flash drive will be automatically mounted under /media/sda1
  • Format the NAND flash kernel partition and write the kernel image onto it:
$ flash_erase /dev/mtd0 0 0
$ nandwrite -p /dev/mtd0 /media/sda1/kernel.img
  • Format the NAND flash root filesystem partition and write Debian filesystem image onto it:
$ ubiformat -O 2048 /dev/mtd1 -f /media/sda1/debian-image.ubi

After Installation

  1. Reset the CM-A510.
  2. Admolition note.png If the boot settings of your CM-A510 are different than default, you may need to press and hold ^C while turning the CM-A510 on, in order to get command prompt.
  3. To boot Linux, type:
    > setenv bootargs "ubi.mtd=1,2048 root=ubi0_0 rootfstype=ubifs useNandHal=4bitecc pm_disable console=ttyS0,115200"
    > nboot 200000 nand0 0; bootm
    Admolition caution.png The Linux kernel for CM-A510 is shipped with built-in command line parameters that define primary console, default display settings, root device and root filesystem type. Setting U-Boot bootargs environment variable overrides default kernel command line!
  4. For Linux automatic boot, type:
    > setenv bootdelay 3
    > setenv bootargs "ubi.mtd=1,2048 root=ubi0_0 rootfstype=ubifs useNandHal=4bitecc pm_disable console=ttyS0,115200"
    > setenv bootcmd "nboot 200000 nand0 0; bootm"
    > saveenv
    > boot
    
    Admolition note.png If you want to get back to U-Boot 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-A510 allows anonymous FTP access.

See also