Sama5d2 Xplained
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.
Kit Information
Kit Overview
Access the console
The usual serial communication parameters are 115200 8-N-1 :
Baud rate | 115200 |
Data | 8 bits |
Parity | None |
Stop | 1 bit |
Flow control | None |
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.
- 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
- 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.
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.
- 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
- For Microsoft Windows users: identify the USB connection that is established
- Now open your favorite terminal emulator with appropriate settings
Demo
Demo archives
| |||||||||||||||||||||||||||||||||||||||||||||||
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_eksd_uboot_defconfig
You can configure AT91Bootstrap to load U-Boot binary from SD Card by doing:
$ 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.
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.
The U-Boot environment variables can be stored in different media, above config files can specify where to store the U-Boot environment.
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:
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:
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
- Boot Logo for SAM SOC's
- Compiling Linux Kernel fails looking at OpenSSL header files
- Connect Module From PDA
- Convert SAM-BA Scripts
- Crypto hardware acceleration
- Hash Error When Booting FIT Image
- Image Sensor Controller White balance features
- Media controller pipeline for image acquisition and SAM MPU products
- How to patch Device Tree Blob in U-boot using Overlays
- How to use Pulse Width Modulation driver
- Using the SAMA5D2-compatible ADC device
- SD card boot for AT91SAM SoC
- USB Gadget Configuration
- How to use the Atmel KMS/DRM LCD driver
- Using FIT Image and Device Tree Overlays
- Using I2SC (Inter-IC Sound Controller)
- External Component on External Bus Interface