Timesys Getting Started Guide for Atmel SAMA5D2 Xplained


Contents

Introduction

This document will describe in detail the procedures for booting a Linux kernel image and mounting a root file system over NFS on the Atmel SAMA5D2 Xplained.

Prerequisites

Host Requirements

To properly boot a board using software from Timesys, your host machine must meet the following requirements:

  • Modern GNU/Linux Distribution. While you can use nearly any modern Linux distribution released in the last 24 months, Timesys recommends one of the following:
    • Ubuntu (Most recent release or LTS)
    • Fedora (Most recent release)
  • An internet connection on the Development Host.
  • Root or sudo permission on the Development Host.
  • A copy of the Linux Kernel (zImage-4.1-ts-armv7l) and Root File System (rootfs.tar.gz) for the Target Board downloaded from Factory. These are found in the output directory of your online build, or in the directory build_armv7l-timesys-linux-<libc>/images/ on the command line.
  • If you are booting your root file system over the network, you will need two network cards installed and configured in the Development Host. One to communicate normally with your LAN/WAN while installing host packages, the other to communicate solely with the target board.
  • An available serial port on your Development Host.

Target Requirements

To boot the Atmel SAMA5D2 Xplained, you will need the following items:

  • Atmel SAMA5D2 Xplained Board
  • Micro USB Cable
  • MicroSD Card
  • Ethernet Crossover Cable or Ethernet hub/switch and Ethernet Patch Cables

Once you have all of the necessary components, you should perform the following steps:

  1. Connect the micro USB port labeled J14 to a USB port of your workstation using the micro USB cable.
  2. If you are using a cross-over cable, connect the Ethernet port of the board to the second Ethernet port of your workstation.
  3. If you are using an Ethernet hub or switch, connect the board to the hub with a straight-through Ethernet cable, then connect the hub to the second Ethernet port of your workstation.
  4. Connect the power supply to your board.

Preparing the Target

Configuring Serial Communication

The SAMA5D2 Xplained uses a serial debug port to communicate with the host machine. The commands discussed in this section are meant to be performed by a privileged user account. This requires the root login or prepending each command with sudo.

Using Minicom

  1. Start minicom on your host machine in configuration mode. As root:

    # minicom -o -s -w

  2. A menu of configuration should appear. Use the Down-arrow key to scroll down and select the Serial port setup option, and press Enter.
  3. Verify that the listed serial port is the same one that is connected to the target board. If it is not, press A, and enter the correct device. This is /dev/ttyACM0 on most Linux distributions.
  4. Set the Bps/Par/Bits option by pressing the letter E and using the next menu to set the appropriate values. You press the key that corresponds to the value 115200, then press Enter.
  5. Set Hardware flow control to No using the F key.
  6. Set Software flow control to No using the G key.
  7. Press Enter to return to the main configuration menu, and then press Esc to exit this menu.
  8. Reset the board, and wait for a moment. If you do not see output from the board, press Enter several times until you see the prompt. If you do not see any output from the board, and have verified that the serial terminal connection is setup correctly, contact your board vendor.

TIP: If you experience an error similar to Device /dev/ttyACM0 is locked when starting minicom, it usually means that another process is using the serial port (which is usually another instance of minicom). You can find the process that is currently using the serial port by executing the following:

# fuser /dev/ttyACM0
/dev/ttyACM0:         28358

# ps 28358
  PID TTY      STAT  TIME COMMAND
  28923 pts/0    S+    0:00 minicom

This process can also be killed directly with fuser as root. Please use this command with caution:

# fuser -k /dev/ttyACM0

Using GNU Screen

To quickly connect to a board using Gnu Screen, execute the following:

# screen /dev/ttyACM0 115200

For more information about using screen, please consult the man page, or view the manual online at http://www.gnu.org/software/screen/manual/screen.html

Preparing the Host

No additional host setup is required to boot from SD.

Booting the Board

Set Environment Variables

You must set a few environment variables in order to boot the board from the SD card. This is done with the setenv and saveenv commands in U-Boot.

On the target, set the following environment variables:

Variable Value
bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
load_kernel fatload mmc :1 22000000 zImage
load_dtb fatload mmc :1 21000000 sama5d2_xplained.dtb
bootcmd mmc rescan\; run load_kernel load_dtb\; bootz 22000000 - 21000000

Example

> setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
> setenv load_kernel fatload mmc :1 22000000 zImage
> setenv load_dtb fatload mmc :1 21000000 sama5d2_xplained.dtb
> setenv bootcmd mmc rescan\; run load_kernel load_dtb\; bootz 22000000 - 21000000
> saveenv

Load The Kernel

You can use the mmc subsystem to load the kernel from the SD card.

Example

> mmc rescan
> fatload mmc :1 22000000 zImage
reading zImage

3008612 bytes read

Load The Device Tree

You can use the mmc subsystem to load the device tree file (dtb) from the SD card.

Example

> mmc rescan
> fatload mmc :1 21000000 sama5d2_xplained.dtb
reading sama5d2_xplained.dtb

24612 bytes read

Boot the Kernel

The bootz command is used to boot the kernel. It loads the file that was previously loaded using the fatload command.

Example

> bootz 22000000 - 21000000
## Booting kernel from Legacy Image at 22000000 ..
   Image Name:   Linux-4.1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3008548 Bytes =  2.9 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
## Flattened Device Tree blob at 21000000
   Booting using the fdt blob at 21000000
   Loading Kernel Image ... OK
OK

Additional Information

Factory Documentation