Legacy Getting Started Page for AT91SAM9N12-EK


This page is a starting point for the Linux4SAM offer and allows you to easily get a running embedded Linux distribution on AT91SAM9N12-EK board.

This Getting started page describes also how a Linux4SAM system boots and how binaries are installed on FLASH memories. For each topic a more detailed section exists with in-depth description, valuables web links, source code and how to rebuild used binaries.

Getting Started AT91Bootstrap U-Boot Linux Rootfs

Linux4SAM Getting Started map

Click on the image above to select a topic

Boot sequence

Several pieces of software are involved to boot a linux kernel on SAM9 products. First is the ROM code which is in charge to check if a valid application is present on supported media (FLASH, DATAFLASH, NANDFLASH, SDCARD).

The boot sequence of linux4SAM is done in several steps :

  1. Boot Program - Check if a valid application is present in FLASH and if it is the case download it into internal SRAM.
    For more information on this topic, please check following diagram extracted from the product datasheet and the Boot capabilities matrix.

  1. AT91Bootstrap - In charge of hardware configuration, download U-Boot binary frome FLASH to SDRAM, start the bootloader
  2. U-Boot - The bootloader, in charge of download kernel binaries from FLASH, network, USB key, etc. Start the kernel.
  3. Linux kernel - The operating system kernel.
  4. Root Filesystem - Contains applications which are executed on the target, using the OS kernel services.

  1. Processor comes out of reset and branches to the ROM startup code.
  2. The ROM startup code initializes the CPU and memory controller, performing only minimal initialization of on-chip devices, such as the console serial port to provide boot diagnostic messages. It also sets up the memory map for the kernel to use in a format that is consistent across platforms, and then jumps to the boot loader.
  3. The boot loader decompresses the kernel into RAM, and jumps to it.
  4. The kernel sets up the caches, initializes each of the hardware devices via the init function in each driver, mounts the root filesystem and execs the init process, which is the ultimate parent of all user mode processes, typically /sbin/initd.
  5. Executing the first program linked against the shared C runtime library (often init) causes the shared runtime library to be loaded. In a typical Linux system, init reads /etc/inittab to execute the appropriate run control script from /etc/rc.d, which execute the start scripts to initialize networking and other system services



  • A Windows XP host (or later) or a Linux distribution to run the SAM-BA tool
  • Power supply stocked with the Evaluation Kit
  • USB Device Cable
  • Serial Cross Cable (Female-Female)
  • AT91SAM9N12-EK Evaluation Kit

AT91SAM9N12-EK (1)


  • a serial terminal emulator (HyperTerminal, minicom, Tera Term, etc.) :
    Serial communication parameters 115200 8-N-1
Baud Rate 115200
Data 8 bits
Parity None
Stop 1 bit
Flow control None
  • SAM-BA 2.11
  • The demo archive provide just below. This archive contains,
    • All 4 components binaries : AT91Bootstrap, u-boot, Linux kernel, root filesystem
    • A TCL/SAM-BA script that interfaces with the SAM-BA tool to flash the demo
    • A .bat script able to run the flashing script calling SAM-BA itself

Flashing a demo on AT91 boards

Before flashing the demo, make sure that you have installed the SAM-BA tool on your host computer.

  • Connect a USB cable on the board
  • Connect a serial link on DBGU connector and open the terminal emulator program
  • JP4 must open so that (BMS==1)to boot from on-chip Boot ROM
  • Press down PB1 and then power up the board; Then release PB1
  • Launch the proper .bat file : this script will run SAM-BA with proper parameters ; on a Linux host, run the .tcl script form the SAM-BA GUI
  • When the logfile.log appears (this will take a few minutes), check that Done. is written a the end of the file
  • Remove the USB cable
  • Power cycle the board
  • Look the system booting on the LCD screen or through the serial line

Playing with the demo

Now you should have the Linux demo up'n running on your board !
You can also access the Linux console through the serial line plugged on DBGU port.
Use the root login account without password.

sam9n12_slide_show.png sam9n12_console.PNG

Going forward

If you want to rebuild this demo from sources, go through each component topic and you will have a comprehensive explanation of it role and how to build it.


1 : *AT91SAM9N12-EK*: common board for every SAM9N1x, SAN9CN1x chip in the family.

r5 - 04 Apr 2018 - 13:12:53 - NicolasFerre
Linux & Open Source for AT91 Microchip Microprocessors

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

Microchip® and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries. This site is powered by the TWiki collaboration platform

Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.

Ideas, requests, contributions ? Connect to LinksToCommunities page.

Syndicate this siteRSS ATOM