Sama5d2 Xplained

Last modified by Microchip on 2025/08/04 10:48

SoC Features

The SAMA5D2 series is a high-performance, ultra-low-power ARM Cortex-A5 processor based MPU. The Cortex A5 processor runs up to 500MHz and features the ARM NEON SIMD engine a 128kB L2 cache and a floating point unit. It supports multiple memories, including latest-generation technologies such as DDR3, LPDDR3, and QSPI Flash. It integrates powerful peripherals for connectivity (EMAC, USB, dual CAN, up to 10 UARTs, etc.) and user interface applications (TFT LCD controller, embedded capacitive touch controller, class D amplifier, audio PLL, CMOS sensor interface, etc.). The devices offer advanced security functions to protect customer code and secure external data transfers. These include ARM TrustZone, tamper detection, secure data storage, hardware encryption engines including private keys, on-the-fly decryption of code stored in external DDR or QSPI memory and a secure boot loader.

sama5d2.png

Kit Information

Kit Overview

SAMA5D2 Xplained

Access the console

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

Baud rate115200
Data8 bits
ParityNone
Stop1 bit
Flow controlNone

Access the console on DEBUG serial port

The serial console can be accessed from two connectors. One is from the DEBUG port with the help of a TTL-to-USB serial cable (marked as DEBUG J1), another is from micro-A USB connector that gives access to the on-board serial-to-USB converter (marked as J14 EDBG-USB).

Using DEBUG on TTL-to-USB connector (DEBUG J1)

  • For Microsoft Windows users: Install the driver of your USB TTL serial cable. FTDI-based ones are the most popular, have a look to this page to get the driver: https://www.ftdichip.com/Drivers/VCP.htm
  • Open JP2 to enable this DEBUG interface
  • Be sure to connect a 3.3V compatible cable and identify its GND pin. Place it properly according to the silkscreen and connect the cable to the board (J1)
    • For Microsoft Windows users: Identify the USB connection that is established, USB Serial Port should appear in Device Manager. The COMxx number will be used to configure the terminal emulator.
      ftdi serial line
       
    • For Linux users: Identify the serial USB connection by monitoring the last lines of dmesg command. The /dev/ttyUSBx number will be used to configure the terminal emulator.
      [605576.562740] usb 1-1.1.2: new full-speed USB device number 17 using ehci-pci
      [605576.660920] usb 1-1.1.2: New USB device found, idVendor=0403, idProduct=6001
      [605576.660933] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [605576.660939] usb 1-1.1.2: Product: TTL232R-3V3
      [605576.660944] usb 1-1.1.2: Manufacturer: FTDI
      [605576.660958] usb 1-1.1.2: SerialNumber: FTGNVZ04
      [605576.663092] ftdi_sio 1-1.1.2:1.0: FTDI USB Serial Device converter detected
      [605576.663120] usb 1-1.1.2: Detected FT232RL
      [605576.663122] usb 1-1.1.2: Number of endpoints 2
      [605576.663124] usb 1-1.1.2: Endpoint 1 MaxPacketSize 64
      [605576.663126] usb 1-1.1.2: Endpoint 2 MaxPacketSize 64
      [605576.663128] usb 1-1.1.2: Setting MaxPacketSize 64
      [605576.663483] usb 1-1.1.2: FTDI USB Serial Device converter now attached to ttyUSB0

A /dev/ttyUSB0 node has been created.

  • Now open your favorite terminal emulator with appropriate settings

Using the micro-A USB connector (J14 EDBG-USB)

You can also access the serial console through the on-board serial-to-USB converter. In fact, the Atmel EDBG (Embedded Debugger) chip on the Evaluation Kit acts as a serial-to-USB converter and is loaded with a firmware that is able to talk USB-CDC protocol.

  • For Microsoft Windows users: Install USB drivers for Atmel and Segger tools. No need to install a driver on any regular Linux distribution.
  • Open JP1 to enable EDBG
  • Close JP2 to disable de DEBUG port J1 (needed to avoid conflict on the UART TX line)
  • Connect the USB cable to the board (J14 EDBG-USB)
    • For Microsoft Windows users: identify the USB connection that is established
      EDBG Virtual COM Port should appear in Device Manager. The COMxx number will be used to configure the terminal emulator.
      EDBG CDC UART Port
       
    • For Linux users: identify the USB connection by monitoring the last lines of dmesg command. The /dev/ttyACMx number will be used to configure the terminal emulator:
      usb 1-1.1.1: new high-speed USB device number 20 using ehci-pci
      usb 1-1.1.1: New USB device found, idVendor=03eb, idProduct=2111
      usb 1-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      usb 1-1.1.1: Product: EDBG CMSIS-DAP
      usb 1-1.1.1: Manufacturer: Atmel Corp.
      usb 1-1.1.1: SerialNumber: ATML0000001989463039
      hid-generic 0003:03EB:2111.0007: hiddev0,hidraw3: USB HID v1.11 Device [Atmel Corp. EDBG CMSIS-DAP] on usb-0000:00:1a.0-1.1.1/input0
      cdc_acm 1-1.1.1:1.1: ttyACM0: USB ACM device
  • Now open your favorite terminal emulator with appropriate settings

Demo

Demo archives

  
Media typeBoardScreenBinaryDescription
Yocto Project / Poky based demo
Boot on SPI Flash
+ rootfs on eMMC
SAMA5D2 Xplained-linux4sam-poky-sama5d2_xplained-headless-2021.04.zip (~ 109 MB)
md5: a738d274b98582634d5898c9856336ab
Linux4SAM Yocto Project / Poky based demo
compiled from tag linux4sam-2021.04
Follow procedure: #Flash_the_demo
PDA5" (TM5000 or AC320005-5)linux4sam-poky-sama5d2_xplained-graphics-2021.04.zip (~ 185 MB)
md5: c7abe71be1687157dfdd9a6f66c61ef0
SD Card imageSAMA5D2 Xplained-linux4sam-poky-sama5d2_xplained-headless-2021.04.img.bz2 (~ 98 MB)
md5: f35c6385524115f9ff9704bc7deb4c1c
Linux4SAM Yocto Project / Poky based demo
compiled from tag linux4sam-2021.04
Follow procedure: #Create_a_SD_card_with_the_demo
PDA5" (TM5000 or AC320005-5)linux4sam-poky-sama5d2_xplained-graphics-2021.04.img.bz2 (~ 170 MB)
md5: 99ae7ce0e4a99be557cff6a85c80bad9
BuildRoot based demo
SD Card imageSAMA5D2 Xplained-linux4sam-buildroot-sama5d2_xplained-headless-2021.04.img.bz2 (~ 53 MB)
md5: cead4c2da96f1bb4c621d4c3314c6a07
Linux4SAM BuildRoot based demo
compiled from tag linux4sam-2021.04
Follow procedure: #Create_a_SD_card_with_the_demo
PDA5" (TM5000 or AC320005-5)linux4sam-buildroot-sama5d2_xplained-graphics-2021.04.img.bz2 (~ 164 MB)
md5: fa4db1df2afb30a591b227d0215ecb97
OpenWrt based demo
SD Card imageSAMA5D2 Xplained-linux4sam-openwrt-sama5d2_xplained-headless-2021.04.img.gz (~ 13 MB)
md5: a67f149c335f2891d805ee625a7da48c
Linux4SAM OpenWrt based demo
compiled from tag linux4sam-2021.04
Follow procedure: #Create_a_SD_card_with_the_demo
  

Flash the demo

Run script to flash the demo

  • download the demo package for the board. They are marked as "Media type: Boot on SPI Flash + rootfs on eMMC " 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_serialflash.bat file
  • for Linux users: Launch the demo_linux_serialflash.sh file
  • this script runs SAM-BA 3 and the associated QML sam-ba script (demo_linux_serialflash_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
  • power 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

Assuming you are at the AT91Bootstrap root directory, you will find a configs folder which contains several default configuration files:

sama5d2_ptc_eknf_uboot_defconfig
sama5d2_ptc_eksd_uboot_defconfig
Information

Tips: nf means to read nandflash, sd means to read mmc card.

You can configure AT91Bootstrap to load U-Boot binary from SD Card by doing:

$ make mrproper
$ make sama5d2_ptc_eksd_uboot_defconfig

If the configuring process is successful, the .config file can be found at AT91Bootstrap root directory.

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 Setup ARM Cross Compiler above.

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.

Once the AT91 U-Boot sources available, cross-compile U-Boot is made in two steps: configuration and compiling. Check the Configuration chapter in U-Boot reference manual.

Information

 Go to the configs/ to find the exact target when invoking make.

The U-Boot environment variables can be stored in different media, above config files can specify where to store the U-Boot environment.

   # To put environment variables in serial flash:
  sama5d2_xplained_spiflash_defconfig
  # To put environment variables in SD/MMC card:
  sama5d2_xplained_mmc_defconfig

Here are the building steps for the SAMA5D2-Xplained board:

# You can change the config according to your needs.
make sama5d2_xplained_spiflash_defconfig
make

The result of these operations is a fresh U-Boot binary called u-boot.bin corresponding to the binary ELF file u-boot.

  • u-boot.bin is the file you should store on the board
  • u-boot is the ELF format binary file you may use to debug U-Boot through a JTag link for instance.

Build Kernel from sources

Now we Configure and Build kernel for sama5d2xplained board:

$ make ARCH=arm sama5_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#

Build Yocto Project rootfs from sources

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.

Recent FAQ