Linux & Open Source related information for AT91 Smart ARM Microcontrollers
Search: 

Getting Started

Introduction

This page is a starting point for the Linux4SAM offer and allows you to easily get a running embedded Linux distribution on AT91 products.

This Getting started 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 how to rebuild used binaries.

Getting Started AT91Bootstrap U-Boot Linux Rootfs

Linux4SAM Getting Started map

Click on the image up 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 the Boot strategies section and particularly the Boot capabilities matrix.
  2. AT91Bootstrap - In charge of hardware configuration, download U-Boot binary frome FLASH to SDRAM, start the bootloader
  3. U-Boot - The bootloader, in charge of download kernel binaries from FLASH, network, USB key, etc. Start the kernel.
  4. Linux kernel - The operating system kernel.
  5. Root Filesystem - Contains applications which are executed on the target, using the OS kernel services.

linux_boot_sequence.png

  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

Linux4SAM DataFlash demo - Memory map

demo_dataflash_map.png

* : On AT91 chips with embedded FLASH 1, AT91Bootstrap is located into the internal FLASH and not in the DataFlash nor NandFlash.

Linux4SAM NandFlash demo - Memory map

demo_nandflash_map.png

* : On AT91 chips with embedded FLASH 1, AT91Bootstrap is located into the internal FLASH and not in the DataFlash nor NandFlash.

Requirements

Hardware

  • a Windows XP host (or above) to run the SAM-BA tool ;
  • power supply stocked with the Evaluation Kit ;
  • USB Device Cable ;
  • serial Cross Cable (Female-Female) ;
  • eventually a DataFlash Card => check Boot capabilities matrix (for AT91SAM9263-EK for example) ;
  • AT91SAM9-EK Evaluation Kit. Check below how kits look like and how to connect them :

AT91SAM9260-EK AT91SAM9261-EK AT91SAM9263-EK (REV-A)
AT91SAM9260-EK AT91SAM9261-EK AT91SAM9263-EK (REV-A)
AT91SAM9XE-EK AT91SAM9RL-EK AT91SAM9263-EK (REV-B) 2
AT91SAM9XE-EK AT91SAM9RL-EK AT91SAM9263-EK (REV-B)

Software

  • a serial terminal emulator (HyperTerminal, minicom, etc.) :

Serial communication parameters 115200 8-N-1 :

Baud rate 115200
Data 8 bits
Parity None
Stop 1 bit
Flow control None

  • AT91 ISP 1.10 (or higher) ; containing the SAM-BA tool => Check the SoftwareTools page ;
  • 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.

Board Description Binary Sources location
at91sam9260ek Linux4SAM console demo archive linux4sam-angstrom-at91sam9260ek.zip (~ 14 MB) AT91Bootstrap
U-Boot
Linux Kernel
OpenEmbedded-Angstrom
at91sam9xeek Linux4SAM console demo archive linux4sam-angstrom-at91sam9xeek.zip (~ 14 MB)
at91sam9261ek Linux4SAM graphical demo archive linux4sam-angstrom-at91sam9261ek.zip (~ 27 MB)
at91sam9263ek Linux4SAM graphical demo archive linux4sam-angstrom-at91sam9263ek.zip (~ 27 MB)
at91sam9rlek Linux4SAM graphical demo archive linux4sam-angstrom-at91sam9rlek.zip (~ 27 MB) 3

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
  • choose the proper procedure depending on your chip through the following table :

AT91SAM9260-EK AT91SAM9261-EK AT91SAM9263-EK (RevA)
  • J7 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • follow the AT91SAM9260EKSamBaRecovery recovery method, if needed
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • J4 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash Jumper (J21)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • plug DataFlash Jumper (J21) back in position 1-2
  • J5-6 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash Card (J9)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • reinsert the DataFlash Card in J9
AT91SAM9XE-EK AT91SAM9RL-EK AT91SAM9263-EK (RevB)
  • erase the content of the internal FLASH by putting the J7 jumper in position 1-2
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • open now J7 (or put in position 2-3), to boot in normal operating mode
  • J11 must be on 1-2 position (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash and NAND Flash Jumpers (J12 & J13)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • close DataFlash and NAND Flash Jumpers (J12 & J13)
  • J5-6 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash Card (J9)
  • remove NAND Flash Jumpers (J29)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • reinsert the DataFlash Card in J9 (only for DataFlash demo)
  • close NAND Flash Jumper (J29)

  • launch the proper .bat file : this script will run SAM-BA with proper parameters
  • when the programmation logfile.log appears (this will take a few minutes), remove the USB cable
  • power cycle the board
  • look the system booting on the LCD screen or trough the serial line
  • calibrate accurately the LCD screen (if needed)

Playing with the demo

Ok, now you should have the Linux demo up'n running on your board ! Have a walk through applications of this demo.

Screenshot-6.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.

For people in a hurry, there is a summary page which collects all material to build from sources : it allows you GoingForward quickly.


Notes

1: Embedded FLASH available on AT91SAM9XE for instance.

2: AT91SAM9263 MRLA or MRLB could be soldered on this board revision. To identity which chip revision you have, check AT91SAM9263-EK user guide at http://atmel.com/dyn/products/tools_card.asp?tool_id=4057

3: Touchscreen driver not available yet ; check LinuxKernel#2_6_24_at91_exp_patch


  Attachment Action Size Date Who Comment
png 9260_board_presentation.png props, move 162.8 K 12 Oct 2007 - 14:24 NicolasFerre  
png 9260_board_presentation_tiny.png props, move 12.5 K 12 Oct 2007 - 14:24 NicolasFerre  
png 9261_board_presentation.png props, move 149.2 K 13 Sep 2007 - 16:08 NicolasFerre  
png 9261_board_presentation_tiny.png props, move 11.2 K 13 Sep 2007 - 16:08 NicolasFerre  
png 9263_board_presentation.png props, move 159.0 K 12 Oct 2007 - 14:25 NicolasFerre  
png 9263_board_presentation_tiny.png props, move 13.2 K 12 Oct 2007 - 14:25 NicolasFerre  
png 9263_revb_board_presentation.png props, move 183.0 K 24 Jun 2008 - 10:07 PatriceVilchez  
png 9263_revb_board_presentation_tiny.png props, move 15.2 K 24 Jun 2008 - 10:08 PatriceVilchez  
png 9rl_board_presentation.png props, move 136.8 K 15 Apr 2008 - 17:32 NicolasFerre  
png 9rl_board_presentation_tiny.png props, move 12.4 K 15 Apr 2008 - 17:32 NicolasFerre  
png 9xe_board_presentation.png props, move 162.8 K 17 Jan 2008 - 15:51 NicolasFerre  
png 9xe_board_presentation_tiny.png props, move 12.4 K 17 Jan 2008 - 15:52 NicolasFerre  
png Linux4SAM_GettingStarted.png props, move 73.1 K 13 Sep 2007 - 08:45 NicolasFerre  
ppt SAM9_Boot_Strategies.ppt props, move 497.5 K 12 Sep 2007 - 12:26 NicolasFerre SAM9 boot strategie addressed by product
png Screenshot-6.png props, move 13.7 K 11 Oct 2007 - 10:02 NicolasFerre  
png demo_dataflash_map.png props, move 16.2 K 25 Jun 2008 - 16:03 PatriceVilchez  
png demo_flash_map.png props, move 16.0 K 18 Jan 2008 - 10:27 NicolasFerre with 9xe map
png demo_nandflash_map.png props, move 13.6 K 25 Jun 2008 - 16:03 PatriceVilchez  
png linux_boot_sequence.png props, move 75.6 K 18 Sep 2007 - 11:55 NicolasFerre  
r40 - 27 Jun 2008 - 10:19:15 - PatriceVilchez
This site is powered by the TWiki collaboration platformCopyright © 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.
Atmel® and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
ARM® and others are registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.
Syndicate this site RSSATOM