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.

이 페이지는 Linux4SAM offer를 위한 시작점이고, AT91 제품군에서 쉽게 embedded Linux 배포를 구동할 수 있게 한다.
이 Getting started는 FLASH memory에 Linux4SAM system을 boot 하고, binaries를 install하는 방법에 대하여 설명한다. 각각의 topic을 위해 더 세부적인 section이 존재하며 사용된 binaries를 rebuild하는 방법인 심오한 설명과,  볼만한 웹 링크, 소스코드를 제공한다.



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.

여러개의 소프트웨어 pieces가 SAM9 제품군의 linux kernel boot를 위해 포함된다. 먼저 ROM code가 있으며, 이것은  유효한 Application이 제공된 media(FLASH, DATAFLASH, NANDFLASH, SDCARD) 에서 present 되는 것을 확인하는 것을 담당한다.

linux4SAM의 boot sequence는 여러 단계로 수행된다.
1. Boot Program - 유효한 application이 FLASH 존재하고 있는지 check하고 존재한다면 내부 SRAM으로 그것을 다운로든 한다.
   추가정보는
Boot strategies section and particularly the Boot capabilities matrix 를 확인해라.
2.
AT91Bootstrap - hardware configuration을 담당,  FLASH에서 SDRAM으로 U-Boot  binary를 다운로드 하고, bootloader를 시작한다.
3. U-Boot - bootloader, FLASH, network, USB key 등으로부터 kernel binaries를 다운로드 하는것을 담당.
4.
Linux kernel - The operating system kernel.
5. Root Filesystem - target에서 실행되고, OS kernel service를 사용하는 application을 포함한다.




  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


1. Processor는 reset을 내보내고 ROM startup code로 분기한다.
2. ROM startup code는 CPU와 memory controller를 초기화 한다. boot diagnostic message를 제공하기 위한 console serial port 같은 on-chip
   devices의 최소 초기화만을 수행한다. 또한 consistent across platforms에서 사용하기 위한 kernel을 위한 memory map을 setup한다. 그리고
   bootloader로 jump한다.
3. boot loader는 RAM으로  kernel을 decompresse하고, 그곳으로 jump한다.
4. kernel은 cache를 setup하고, 각 driver에서 init function을 거쳐 hardware devices를 각각 초기화하고, root filesystem을 mount하고 init process를
    exec한다. 모드 user mode process의 ultimate parent는 보통 /sbin/initd 이다.
5. shared C runtime library(often init) 대한  링크된 첫번째 프로그램을 실행하는 것은 shared runtime libary를 loaded되게 하는 원인이 된다. 보통
    linux system에서, init는 /etc/rc.d로부터 적절한 run control script를 실행하기 위한 /etc/inittab을 read한다. 그리고 그것은 networking과 다른
    system service 를 초기화하기 위한 start script를 실행한다.


Linux4SAM DataFlash demo - Memory map



Linux4SAM NandFlash demo - Memory map


 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) ;
  • 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)
AT91SAM9G20-EK AT91SAM9G10-EK AT91SAM9G45-EKES and AT91SAM9M10G45-EK
AT91SAM9G20-EK AT91SAM9G10-EK AT91SAM9G45-EKES and AT91SAM9M10G45-EK

                                    AT91SAM9260-EK

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

Demo binaries

Board Description Binary Sources location
at91sam9260ek Linux4SAM console demo archive linux4sam-angstrom-at91sam9260ek.zip (~ 18 MB) AT91Bootstrap
U-Boot
Linux Kernel
OpenEmbedded-Angstrom
at91sam9xeek Linux4SAM console demo archive linux4sam-angstrom-at91sam9xeek.zip (~ 18 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)
at91sam9g20ek3 Linux4SAM console demo archive linux4sam-angstrom-at91sam9g20ek.zip (~ 19 MB)
at91sam9g10ek Linux4SAM graphical demo archive linux4sam-angstrom-at91sam9g10ek.zip (~ 27 MB)
at91sam9g45ekes Linux4SAM graphical demo archive linux4sam-angstrom-at91sam9g45ekes.zip (~ 27 MB)

Board Description Binary Sources location
at91sam9260ek Linux4SAM console demo archive linux4sam-buildroot-at91sam9260ek.zip (~ 14 MB) AT91Bootstrap
U-Boot
Linux Kernel
Buildroot
at91sam9xeek Linux4SAM console demo archive linux4sam-buildroot-at91sam9xeek.zip (~ 14 MB)
at91sam9261ek Linux4SAM console demo archive linux4sam-buildroot-at91sam9261ek.zip (~ 14 MB)
at91sam9263ek Linux4SAM console demo archive linux4sam-buildroot-at91sam9263ek.zip (~ 14 MB)
at91sam9rlek Linux4SAM console demo archive linux4sam-buildroot-at91sam9rlek.zip (~ 14 MB)
at91sam9g20ek3 Linux4SAM console demo archive linux4sam-buildroot-at91sam9g20ek.zip (~ 16 MB)
at91sam9g10ek Linux4SAM console demo archive linux4sam-buildroot-at91sam9g10ek.zip (~ 14 MB)
at91sam9g45ekes Linux4SAM console demo archive linux4sam-buildroot-at91sam9g45ekes.zip (~ 14 MB)

Old binaries linux4sam demo v1.4 through v1.6


 

Flashing a demo on AT91 boards

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

demo를 flashing하기 전에, host computer에 SAM-BA tool이 installed되었는지 확인한다.

  • 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 : 

보드에 USB cable을 연결한다.
DBGU에 serial link을 연결하고 터미널 에뮬레이터 프로그램을 open한다.
아래의 테이블을 통해 chip에 맞는 적절한 과정을 선택한다.

    AT91SAM9260-EK

        + 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)

        + on-chip Boot ROM으로부터 boot하기 위해 J7은 open 되어야만 한다. (BMS=1)
        +
AT91SAM9260EKSamBaRecovery
 복구 방법을 따른다.
        + 보드를 power-up 한다.
        + USB가 연결되었는지 확인한다. (ATMEL AT91xxxxx Test Board appears in taskbar notification area)


 

  • 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)


적당한 .bat 파일을 launch한다 : 이 script는 적당한 parameter를 갖는 SAM-BA를 run할 것이다. Linux host에서 SAM-BA로부터 .tcl script를 run한다.
logfile.log 가 나타나면(this will take a few minutes), USB cable을 뺀다.
power는 board를 순환함.
LCD screen과 serial line을 통해 system booting을 확인한다.
LCD screen을 calibrate한다 (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.




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: 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: In addition to single slot AT91SAM9G20EK demo files, it contains also demo files for dual SD/MMC slot AT91SAM9G20EK.

  • at91sam9g20ek_demo_linux_<media>.* apply to at91sam9g20ek rev. A and rev. B
  • at91sam9g20ek_2mmc_demo_linux_<media>.* apply to at91sam9g20ek rev. C and onwards

4: 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


 

'[C-03] AT91SAM9260' 카테고리의 다른 글

Linux4SAM - AT91Bootstrap  (0) 2009.11.15
Linux4SAM - Software Tools  (0) 2009.11.15
AT91SAM Community  (0) 2009.11.10
KEIL ARM의 AT91SAM9260 Device Database site  (0) 2009.11.10
Free LinuxLink Trial  (0) 2009.11.10
Posted by eoseontaek