Legacy 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 SAM 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 NandFlash demo - Memory map

demo_nandflash_map.png

Requirements

Hardware

  • 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) ;
  • eventually a DataFlash Card => check Boot capabilities matrix (for AT91SAM9263-EK for example) ;
  • the 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) (1)
AT91SAM9XE-EK AT91SAM9RL-EK AT91SAM9263-EK (REV-B)
!AT91SAM9G20-EK !AT91SAM9G10-EK !AT91SAM9G45-EKES,
AT91SAM9M10-EKES and AT91SAM9M10G45-EK
AT91SAM9G20-EK AT91SAM9G10-EK AT91SAM9G45-EKES, AT91SAM9M10-EKES and AT91SAM9M10G45-EK

Software

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

Exceptions:

  • sama5d2 revision A, only to access the ROMCode through serial interface and see the RomBOOT message appearing, configure your serial line to 57600.
    Change it back to 115200 for normal operation.
    All components and demo binaries are now configured to work at 115200 8-N-1.

The usual serial communication parameters are 115200 8-N-1 :

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

  • AT91 ISP 1.10 (or later) ; 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.

Old binaries old linux4sam demo directories

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) (2)
!AT91SAMG20-EK !AT91SAMG10-EK !AT91SAM9G45-EKES
  • J7 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash and NAND Flash Jumpers (J33 & J34)
  • 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 (J33 & J34)
  • J4 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove DataFlash and NAND Flash Jumpers (J21 & J24)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • close DataFlash (J21) back in position 1-2
  • close NAND Flash Jumper (J24)
  • Check and conform to the Default Jumpers Settings
  • First of all, be sure that the ROM code replacement is located in Dataflash to workaround the issue with SAM-BA access through USB. Please refer to the Errata on AT91SAM9G45 Engineering Sample Devices document
  • JP8 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove NAND Flash Jumper (JP10)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • close NAND Flash Jumper (JP10)
!AT91SAM9M10-EKES and AT91SAM9M10G45-EK    
  • Check and conform to the Default Jumpers Settings
  • JP8 must be opened (BMS=1) to boot from the on-chip Boot ROM
  • remove NAND Flash Jumper (JP10)
  • power up the board
  • verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
  • close NAND Flash Jumper (JP10)
   

  • 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), 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.
You can also access the Linux console through the serial line plugged on DBGU port.
Use the root login account without password.

Use Demo

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.


Notes

1 : !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

2 : If you experience issues with NAND flash accesses,
please refer to the AT91SAM9263-EK Evaluation Board Rev. B User Guide chapter 1.5 NAND Flash Access Issue


Topic attachments
I Attachment Action Size Date Who Comment
PNGpng 9260_board_presentation.png manage 162.8 K 2007-10-12 - 14:24 NicolasFerre  
PNGpng 9260_board_presentation_tiny.png manage 12.5 K 2007-10-12 - 14:24 NicolasFerre  
PNGpng 9261_board_presentation.png manage 149.2 K 2007-09-13 - 16:08 NicolasFerre  
PNGpng 9261_board_presentation_tiny.png manage 11.2 K 2007-09-13 - 16:08 NicolasFerre  
PNGpng 9263_board_presentation.png manage 159.0 K 2007-10-12 - 14:25 NicolasFerre  
PNGpng 9263_board_presentation_tiny.png manage 13.2 K 2007-10-12 - 14:25 NicolasFerre  
PNGpng 9263_revb_board_presentation.png manage 183.0 K 2008-06-24 - 10:07 PatriceVilchez  
PNGpng 9263_revb_board_presentation_tiny.png manage 15.2 K 2008-06-24 - 10:08 PatriceVilchez  
PNGpng 9g10_board_presentation.png manage 129.6 K 2009-06-11 - 14:06 NicolasFerre  
PNGpng 9g10_board_presentation_tiny.png manage 11.5 K 2009-06-11 - 14:06 NicolasFerre  
PNGpng 9rl_board_presentation.png manage 136.8 K 2008-04-15 - 17:32 NicolasFerre  
PNGpng 9rl_board_presentation_tiny.png manage 12.4 K 2008-04-15 - 17:32 NicolasFerre  
PNGpng 9xe_board_presentation.png manage 162.8 K 2008-01-17 - 15:51 NicolasFerre  
PNGpng 9xe_board_presentation_tiny.png manage 12.4 K 2008-01-17 - 15:52 NicolasFerre  
PNGpng Screenshot-6.png manage 13.7 K 2007-10-11 - 10:02 NicolasFerre  
PNGpng demo_dataflash_map.png manage 17.0 K 2008-12-12 - 12:57 NicolasFerre  
PNGpng demo_nandflash_map.png manage 13.6 K 2008-06-25 - 16:03 PatriceVilchez  
r4 - 04 Apr 2018 - 13:13:46 - 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