SAM9X60-EK -- Booting from SD Memory Card

Introduction

In this topic, you will configure and program the SAM9X60-EK evaluation kit to boot from an external SD Memory Card. You will write a pre-built image to an SD Memory Card using the SAM-BA® In-System Programmer (ISP). The image will contain the second-stage bootloader at91bootstrap, third-stage bootloader u-boot-at91, u-boot environment, the Flattened Image Tree (FIT) (containing the Linux® kernel and Device Tree), and Root File System (RFS).

Steps:


Prerequisites

Familiar with the features of the SAM9X60-EK evaluation kit:

Familiar with the operation of the SAM-BA ISP:

Setup Console Serial Communications with the SAM9X60-EK:

Knowledge of the Boot Process


Hardware

sam9x60-ek.png

For this topic, you will be using the SAM9X60-EK. You will also need two USB Micro-B cables. One cable will connect the Host PC to the target console to view the SAM-BA Monitor log message. The second cable will connect the Host PC to the target USBA port (J7) so that the SAM-BA Host can communicate with the SAM-BA Monitor.

Bootable Memory

sam9x60-ek-mass-storage.png

The SAM9X60-EK has an SD Memory Card slot (J4) where you will insert your SD Memory Card after flashing an image to it. In this training topic, you will use the SAM-BA ISP to write the image to the SD Memory Card.


SAM-BA ISP

In this section, you will load the SAM-BA Host Application (if you have not already done so) and setup Console and SAM-BA Host to Monitor communications.

1

Setup SAM9X60-EK Console Serial Communications

To view the SAM-BA Monitor log messages, setup console serial communications following the instructions in the topic: SAM9X60-EK Console Serial Communications

You have two choices in connecting to a serial port on the SAM9X60-EK:

  • The first is using a USB cable to connect to the J-LINK-OB port (J22). This method has the added benefit of powering the SAM9X60-EK.
  • The second is using a USB-to-TTL converter to connect to the Universal Asynchronous Receiver Transmitter (UART) Debug port (J24). To power the SAM9X60-EK, you will need to:
    • Use an external 5 VDC power supply connected to J1 (coaxial power jack), or
    • Use a USB cable connect to the USBA port (J7).
j-link-ob-port.png

Operation of the J-Link Debugger will be displayed by a green LED (D9).

serial-uart-debug-port.png

2

If it is not already installed, install the SAM-BA Host Application.

SAM-BA ISP should be added to the system PATH variable.

$ export PATH=$PATH:<path_to_sam-ba>

This will enable you to access the SAM-BA ISP from anywhere on your system.

3

Setup the SAM-BA Host to Monitor Serial Communications

a

To communicate with SAM-BA Monitor on the target, you must have installed the SAM-BA Host on a Linux PC (Step 2 above), and connect a USB Micro-B cable from the host PC to the USBA port (J7) on the SAM9X60-EK as shown in the figure below.

sam9x60-ek-sam-ba-comms.png

You may power the SAM9X60-EK one of two ways:

  1. Using an external 5 VDC power supply connected to J1 (coaxial power jack), or
  2. Using a USB cable connect to the USBA port (J7).

b

Ensure there is no SD Memory Card inserted in slot J4.

c

Close the DIS_BOOT (J13) jumper.

Closing this jumper prevents booting from external memories such as QSPI and NAND Flash.

d

Press the Reset button (SW3).

Observe ROMBoot on the Console (terminal emulator) indicating the SAM-BA Monitor is running.


Write Image to SD Memory Card

In this section, you will download a demonstration image from the Linux4sam website and write the image to an SD Memory Card using the SAM-BA ISP.

1

Download the SAM9X60-EK demonstration image from the Linux4SAM website.

The latest demonstration images for the SAM9X60-EK are available on the Linux4SAM website.

There you will find three sets of images created from one of three Build Systems:

  • The Yocto Project
  • Buildroot
  • OpenWRT

Any of the images can be used for this step. If you are undecided, choose the linux4sam-buildroot-sam9x60ek-headless file and extract the image.

2

Insert a SD Memory Card into slot (J4).

The SD Memory Card size should be 1 GB or greater.

sd-memory-card-slot.png

3

Write the demo image to SD Memory Card.

Execute the following command in the command window (command line interface):

$ sam-ba -p serial -b sam9x60-ek -a sdmmc -c write:linux4sam-buildroot-sam9x60ek-headless-2020.04.img
Opening serial port 'ttyACM0'
Connection opened.
Detected memory size is 7948206080 bytes.
Page size is 512 bytes.
Buffer is 9728 bytes (19 pages) at address 0x0030a840.
Executing command 'wrie:linux4sam-buildroot-sam9x60ek-headless-2020.04.img'
Wrote 9728 bytes at address 0x00000000 (0.00%)
Wrote 9728 bytes at address 0x00002600 (0.00%)
..
..
Wrote 9728 bytes at address 0x410fe000 (100.00%)
Wrote 8192 bytes at address 0x410fe000 (100.00%)
Connection closed.


Boot from SD Memory Card

Check that:

  • Console serial communications are working properly.
  • The SD Memory Card is inserted into slot J4.
  • Ensure the DIS_BOOT jumper (J13) is CLOSED. This will prevent the MPU from booting from QSPI or NAND Flash memory.

The Disable Boot mechanism of Jumper J13 does not disable booting from the SD Memory Card. The user must remove the SD Memory Card to prevent booting from it.

1

With all preparations completed, press the Reset button (SW3).

2

Observe:

  • The Linux boot log on the Console (terminal emulator).
  • At the end of the boot sequence, a command line prompt will appear.
    • Login as "root".
    • There is no password required.
  • The Linux operating system heartbeat is displayed on RGB LED (LD1) as a flashing blue light.
sam9x60-ek-login.png

Congratulations! You have booted an embedded Linux system on the SAM9X60-EK evaluation kit using an SD Memory Card as external mass memory.


Summary

In this training topic, you prepared a Host PC to run the SAM-BA ISP, connected the Host PC to the SAM9X60-EK evaluation kit (the Target), and flashed a demonstration image to an SD Memory Card using the SAM-BA ISP. Finally, you booted the Linux operating system on the SAM9X60-EK.


What’s Next?

© 2020 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.