AT91SAM9x5 EK

Last modified by Microchip on 2025/06/09 10:55

SoC Features

Kit Information

Kit Overview

Access the console

Demo

Demo archives

Create a SD card with the demo

You need a 1 GB SD card (or more) and to download the image of the demo. The image is compressed to reduce the amount of data to download. This image contains:

  • a FAT32 partition with the AT91Bootstrap, U-Boot and the Linux Kernel (zImage and dtb).
  • an EXT4 partition for the rootfs.

Multi-platform procedure

To write the compressed image on the SD card, you will have to download and install balenaEtcher. This tool, which is an Open Source software, is useful since it allows to get a compressed image as input. More information and extra help available on the balenaEtcher website.

Insert your SD card and launch Etcher:
etcher_sel.jpg

Select the demo image. They are marked as "SD Card image" in the demo table above.
Note that you can select a compressed image (like the demos available here). The tool is able to decompress files on the fly

Select the device corresponding to your SD card (Etcher proposes you the devices that are removable to avoid erasing your system disk)

Click on the Flash! button

On Linux, Etcher finally asks you to enter your root password because it needs access to the hardware (your SD card reader or USB to SD card converter)

then the flashing process begins followed by a verification phase (optional)

etcher_finishing.jpg

Once writing done, Etcher asks you if you want to burn another demo image:

etcher_done.jpg

Information

Your SD card is ready!

 

Flash the demo

Run script to flash the demo

  • download the demo package for the board. They are marked as "Media type: NAND Flash " in the table above
  • extract the demo package
  • run your usual terminal emulator and enter the demo directory
  • make sure that the sam-ba application is in your Operating System path so that you can reach it from your demo package directory
  • for Microsoft Windows users: Launch the demo_linux_nandflash.bat file
  • for Linux users: Launch the demo_linux_nandflash.sh file
  • this script runs SAM-BA 3 and the associated QML sam-ba script (demo_linux_nandflash_usb.qml) with proper parameters
  • when you reach the end of the flashing process (this will take a few minutes), the following line is written:
    -I- === Done. === 
  • connect a serial link on DBGU and open the terminal emulator program as explained just above
  • ower cycle the board
  • monitor the system while it's booting on the LCD screen or through the serial line

Build From source code

Setup ARM Cross Compiler

Build AT91Bootstrap from sources

Build U-Boot from sources

Getting U-Boot sources

Cross-compiling U-Boot

Before compiling the U-Boot, you need setup cross compile toolchain in the section.

Warning

Latest versions of U-boot (2018.07 and newer) have a minimum requirement of 6.0 version of the GCC toolchain. We always recommend to use the latest versions.

Build Kernel from sources

Required packages

You must install essential host packages on your build host. These requirements are listed in the Linux kernel documentation with the chapter Install build requirements. You must follow this process which includes, but not limited to, the following packages:

  • build-essential
  • flex
  • bison
  • git
  • perl-base
  • libssl-dev
  • libncurses5-dev
  • libncursesw5-dev
  • ncurses-dev

Getting Kernel sources

To get the source code, you have to clone the repository:

$ git clone https://github.com/linux4microchip/linux.git
Cloning into 'linux'...
remote: Enumerating objects: 8587836, done.
remote: Total 8587836 (delta 0), reused 0 (delta 0), pack-reused 8587836
Receiving objects: 100% (8587836/8587836), 3.49 GiB | 13.44 MiB/s, done.
Resolving deltas: 100% (7117887/7117887), done.
Updating files: 100% (70687/70687), done.
$ cd linux

The source code has been taken from the master branch which is pointing on the latest branch we use.

Information

 Note that you can also add this Linux4SAM repository as a remote GIT repository to your usual Linux git tree. It will save you a lot of bandwidth and download time:

$ git remote add linux4microchip https://github.com/linux4microchip/linux.git
$ git remote update linux4microchip
Fetching linux4microchip
From https://github.com/linux4microchip/linux
* [new branch]                linux-6.6-mchp -> linux4microchip/linux-6.6-mchp
* [new branch]                linux-6.12-mchp -> linux4microchip/linux-6.12-mchp
* [new branch]                master     -> linux4microchip/master

If you want to use another branch, you can list them and use one of them by doing this:

$ git branch -r
  linux4microchip/linux-6.1-mchp
  linux4microchip/linux-6.1-mchp+fpga
  linux4microchip/linux-6.6-mchp
  linux4microchip/linux-6.6-mchp+fpga
  linux4microchip/linux-6.12-mchp
  linux4microchip/master
$ git checkout -b linux-6.12-mchp --track remotes/linux4microchip/linux-6.12-mchp
Branch linux-6.12-mchp set up to track remote branch linux-6.12-mchp from linux4microchip.
Switched to a new branch 'linux-6.12-mchp'

Setup ARM Cross Compiler

  • First step is to dowload the ARM GNU Toolchain:

    wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz 
  • Next step is to add the ARM GNU Toolchain into your system:

    tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
    export CROSS_COMPILE=`pwd`/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-

    or

    tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
    export CROSS_COMPILE=arm-none-linux-gnueabihf-
    export PATH=$PATH:/YOUR/PATH/TO/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-linux-gnueabihf/bin/
    • Information

       If you already have an old ARM GNU Toolchain need to clean up the PATH with:

      export PATH=${PATH/':/YOUR/PATH/TO/arm-gnu-toolchain-VERSION-x86_64-arm-none-linux-gnueabihf/bin/'/}
          

    Configure and Build the Linux kernel

    Now you have to configure the Linux kernel according to your hardware. We have two default configuration at91 SoC in arch/arm/configs

    arch/arm/configs/at91_dt_defconfig
    arch/arm/configs/sama5_defconfig
    arch/arm/configs/sama7_defconfig
    • at91_dt_defconfig: for SAM9 (ARM926) series chips
    • sama5_defconfig: for SAMA5 series chips
    • sama7_defconfig: for SAMA7 series chips

     

At this step, you can modify default configuration using the menuconfig

  • $ make ARCH=arm menuconfig

    Now, in the menuconfig dialog, you can easily add or remove some features. Once done, Move to <Exit> with arrows and press this button hitting the Enter key to exit from this screen.

    Build the Linux kernel image, before you build you need set up the cross compile toolchain, check this section.

    $ make ARCH=arm

    [..]

      Kernel: arch/arm/boot/Image is ready
      Kernel: arch/arm/boot/zImage is ready

    Now you have an usable compressed kernel image zImage.

    If you need an uImage you can run this additional step:

    make ARCH=arm uImage LOADADDR=0x20008000

    [..]

    Kernel: arch/arm/boot/Image is ready
    Kernel: arch/arm/boot/zImage is ready
    UIMAGE  arch/arm/boot/uImage
    Image Name:   Linux-6.12.22-linux4microchip-20
    Created:      Thu May 22 18:05:21 2025
    Image Type:   ARM Linux Kernel Image (uncompressed)
    Data Size:    5688984 Bytes = 5555.65 KiB = 5.43 MiB
    Load Address: 20008000
    Entry Point:  20008000
    Kernel: arch/arm/boot/uImage is ready
    make ARCH=arm dtbs

    [..]

      DTC     arch/arm/boot/dts/microchip/at91-sama5d27_som1_ek.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama5d2_icp.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama5d3_eds.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dtb
      DTC     arch/arm/boot/dts/microchip/at91-sama7g5ek.dtb

    [..]

    If the building process is successful, the final images can be found under arch/arm/boot/ directory.

Build Yocto Project rootfs from sources

Failed to execute the [display] macro. Cause: [Current user [null] doesn't have view rights on document [xwiki:Development.applications.linux4sam.faq.oebuild.oe-build.WebHome]]. Click on this message for details.

Using SAM-BA to flash components to board

Launch SAM-BA tools

  • According to this section make sure that the chip can execute the SAM-BA Monitor.

Configure NAND ECC

Using default PMECC parameters

Programming components into NAND

Program AT91Bootstrap binary

Program U-Boot binary

Recent FAQ