RoadTest: Atmel SAMA5D4 Xplained Ultra
Author: amgalbu
Creation date:
Evaluation Type: Independent Products
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?:
What were the biggest problems encountered?: Poor documentation and community support
Detailed Review:
Kit content
The Atmel SAMA5D4 Xplained Ultra kit comes in a nice box that contains just the board and a USB cable
The first impression I had when I saw the board was "this is huge". I mean, the board is sensibly larger to its competitors (Raspberry Pi and BeagleBone). So the expectation I have now is due to a very simple equation: larger = more powerful...
The size of the board is for the most part due to the various expansion headers. There are 7 expansion headers.
It's obvious that the intent of the designers was to exploit to the utmost the great wealth of shields available for the Arduino platform and make the SAMA5D4 a future-proof replacement in many projects that are currently based on low-resourced Arduino.
This are the key features of the board
Atmel SAMA5D4 Cortex®-A5-based microprocessor
512MBytes DDR2
512MBytes SLC NAND Flash
1x SD/eMMC and 1x MicroSD slots
LCD connectors compatible with PDA4301
HDMI connector
Ethernet 10/100 with PHY and connectors
Three USB connectors (2 Host + 1 Device)
Expansions headers, Arduino R3 Shield compatible
Power measurement straps
The board is anonymous, in that it does not have neither nothing particularly good nor particularly bad.
I noted that there is not a plug to power the board for an external power supply other that the USB port. The specifications state that an external power supply can be connected to J4, but the jack connector is optional.
One of the most important features of the SAMA5D4 board is that Atmel provides for this board a porting of the Android operating system. This should be great: it's just up to your fantasy to find a problem that has not already been addressed by an existing app. The main problem is: how the hardware resource a designer typically expected to have access to in an embedded system integrates in Android? What is the cost in terms of performances?
I downloaded one of the test images from
http://www.at91.com/android4sam/bin/view/Android4SAM/Android4SAMv44RC1
Because I had no LCD displays compatible with the LCD connector on the board, I decided to use the HDMI output. If you are using the demo image, you will have to make a minor change to the tcl file in order to load the proper dtb file. In particular,
I downloaded a Linux image with HDMO support included from ftp://ftp.linux4sam.org/pub/demo/
I copied the dtb file (at91-sama5d4_xplained_hdmi.dtb) into the directory where I unzipped the Android image
I edited the sama5d4_xplained_nandflash.tcl to load the proper dtb file
#set dtbFile "at91-sama5d4_xplained_pda4.dtb"
set dtbFile "at91-sama5d4_xplained_hdmi.dtb"
I downloaded to the NAND Flash. It is also possible to boot from an external SD card, but I wanted to test the real performances of the processor, without the bottleneck due to the SD transfer rate.
Flashing the image was not as easy as I expected. This is how I accomplished this task
register on the atmel website
download and install SAM-BA tools from http://www.atmel.com/tools/atmelsam-bain-systemprogrammer.aspx
download and install EDBG USB drivers from https://gallery.atmel.com/Products/Details/6873be43-0628-46ac-ba83-286869a3d97a
download and install FTDI drivers from http://www.ftdichip.com/Drivers/VCP.htm
short the J7 jumper (Note: the pin header is smaller than the usual 0.1 inches format and is closed to the JTAG connector. So shorting and opening the jumper is not an easy task...)
connect the USB cable to the USB mini connector identified on the board as J11
open the J7 jumper (BE SURE TO DO THIS BEFORE PROCEEDING)
if you are using the prebuilt image, run the .bat file included and wait until an instance of NotePad pops up
if you want to see console output, disconnect the USB cable from the EDBG connector and connect to the connector identified as J11
Here is a small caveat: the serial port for the console is a USB device that is mounted some time after U-Boot has started. So, the first time you power up the board after flashing a new image, U-Boot stops waiting for user input, but you cannot see anything on the console because USB serial port has not been mounted yet. You have to press "Enter" to let U-Boot continue the boot process.
Android should boot... and you will be very surprised to see how slow it is!! It's unusable!! The mouse cursor does not even follow the mouse movements!! It was very disappointing. I got the same result both with the image I built from scratch and with the prebuilt image. The only reason I can see for Atmel to claim that this board supports Android is that with the resolution of an HDMI monitor (1280 x 920) is too high for the processing power of this CPU. Probably with a display connected to the LCD connector (which for sure has a lower resolution) things are going to be much better
Besides that, I wasn't able to find any reference to an SDK that will let you access hardware resources (e.g. GPIOs) directly from Java. I hope at Atmel are not thinking the final user to develop a JNI to access GPIOs...
Since Android was unusable, I downloaded the prebuilt image of the Linux operating system. I followed the same steps and booted the board from this address.
There are some others images here
ftp://ftp.linux4sam.org/pub/demo/
My first thought was that the board was not running at all, because the monitor was completely dark. So I opened the console and I found out that the board was actually running, but there was no desktop manager running.
The only way to see something on the screen was to download a sample application launcher from liunx4sam FTP site and launch from console.
The application launcher is a Qt application. However, I was not able to interact because it seems there was no support for the mouse (even if I could see informational message on the console that stated that USB mouse was correctly recognized and installed)
Interaction with the hardware is similar to what you can find on a Raspberry board (and on a Debian distribution in general). Here is an abstract of a full guide available here
There is an handy guide here about pins
http://www.at91.com/linux4sam/bin/view/Linux4SAM/IioAdcDriver
To list the available analogue devices run
ls -l /sys/bus/iio/devices/iio\:device0/
Note there are 5 analog input channels in_voltage0 - in_voltage4 these are NOT mapped to pins A0 – A4 but instead are mapped to pins A1 – A5. For example,
cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
will read from ADC channel 0 and show the raw value between 0 and 1023 (12 Bit) lest say it showed "948"
cat /sys/bus/iio/devices/iio\:device0/in_voltage_scale
will show the scale value and will typically return 3222.00000 indicating the uV per count in this case so if we multiply 948 and 3222 we get 3054456 which is 3.05V so full scale 1023 would = 3.296V (VREF= 3V3)
in_voltage0_raw --> PIN A1 on the board
in_voltage1_raw --> PIN A2 on the board
If the analog inputs are not enabled then run this to enable them (I have not tried beyond this list)
# echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage0_en
GPIO pins are enabled by using commands like the following
echo 8 > /sys/class/gpio/export results in pioA8 echo 24 > /sys/class/gpio/export results in pioA24 echo 32 > /sys/class/gpio/export results in pioB0 echo 48 > /sys/class/gpio/export results in pioB16 echo 64 > /sys/class/gpio/export results in pioC0 echo 96 > /sys/class/gpio/export results in pioD0
now as some pins are already defined by the OS for their operation, you will find that even though the command seems to work, it won't show up on the expected pins
This one however proved to work without an issue
echo 33 > /sys/class/gpio/export results in pioB1
to set the direction of the pins we simply output an "in" or "out" to the direction folder as follows
echo "out" > /sys/class/gpio/pioXX/direction
or specifically
echo "out" > /sys/class/gpio/pioB1/direction
and to change values when set as output use
echo 1 > /sys/class/gpio/pioXX/value
to set the output high or
echo 0 > /sys/class/gpio/pioXX/value
to set the output low and for inputs it is just as simple
cat /sys/class/gpio/pioXX/value
if you also want to list all your GPIO settings / status you can run the command
cat /sys/kernel/debug/gpio
if it does not work try running this first to enable the debug ability
mount -t debugfs none /sys/kernel/debug
Atmel provides an environment for building Qt applications that can be downloaded from this link
http://www.at91.com/linux4sam/bin/view/Linux4SAM/GettingStarted#Demoa5d4xplained
To install, type
sudo ./tmp/deploy/sdk/poky-eglibc-x86_64-meta-toolchain-qte-cortexa5hf-vfp-toolchain-qte-1.5.1.sh
The installation directory (/opt/poky/1.5.1) contains a setup script which can be sourced to initialize all required environment variables.
cd /opt/poky/1.5.1 source environment-setup-cortexa5hf-vfp-poky-linux-gnueabi
Full details about Qt SDK are available here
http://www.at91.com/linux4sam/bin/view/Linux4SAM/PokyBuild#Atmel_Poky_Qt_Embedded_SDK
Then you can start development by following the step-step instructions provided at this link
http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#application-development-workflow
Also a software library package is available here
http://www.atmel.com/tools/SAMA5D4SOFTWAREPACKAGE.aspx
which provides some basic function libraries to access hardware resources from a C/C++ application (something similar to what you expect to find for a bare-metal microcontroller). The library also include some application that can be imported (even if the process is nor so plain vanilla, as it requires some manual configurations) in the Eclipse IDE. In particular, I tried to build a "Getting started" application using the Eclipse ARM DS-5 IDE available here
http://ds.arm.com/ds-5-community-edition/
It's hard for me to say that this roadtest has been disappointing. I enrolled with the hope to test a board that was supposed to support Android out-of-the-box, but in reality performances were very poor and it has been impossible to run any application or any test
With Linux, I would have expected to have at least a desktop manager to play with. In reality, you have to develop your application (I saw examples on Linux4SAM FTP server created with Qt) from scratch. This is probably the best solution from the point of view of the performances (since you don't have to carry the weight of an X server and a desktop manager) but makes also impossible to leverage any Linux built-in feature.
To be honest, I cannot think of a niche where this board should be preferred to a Raspberry or a BeagleBoneBlack. The only advantage it provides over other boards is the number of I/Os available. Apart from this, you will probably have to spent a great amount of time to cope with the peculiarities of the Linux distribution. Also, in my opinion, what makes the difference among the number of SBC and SoC out there is the support. Neither an hobbyist nor a professional designer is happy to spend hours setting up the development environment or to debug the simplest application just because you can't leverage the xpertise provided by an active ecosystem
Product Performed to Expectations
As I said, the performances of the product were well below my expectations, in particular as far as the Android image is involved. Probably the provided image is designed to run on the A9 board. When the Linux image is loaded, the computing power of the A5 CPU is enough to run smoothly graphical applications build with Qt
Specifications were sufficient to design with
Hardware specifications regarding pins are available and are clear and detailed
Demo was easy to use
Demo software is not as easy to use as you would expect on a demo board. In my opinion, an evaluation board should make the designer say "Wow, this is exactly what I need" in an half an hour or less. In the case of the Atmel SAMA5D$ Xplained Ultra, you have to solve many time-consuming issues before even being able to blink a LED. The standard image has not a demo user interface you can play with
Demo Software was of good quality
I can't say demo software is bad.. there are some demo applications that looks quite good and make you feel the power of this board (especially as far as the graphical performances are concerned), but they are simply a bit too difficult to use
Support materials were available
Support material is available but it is distribute over many site and has there is not a step-by-step tutorial to guide you through the setup of the development environment
The price to performance ratio was good
The board is not cheap: it costs 82.94 euros + VAT. And in my opinion it does not worth all that money. A Raspberry board costs less than a half and provides more power and (above all) more support
Pros
Good solution if you want to develop a visual application from scratch using Qt
Plenty of expansion headers available
Powerful low-level debugging tools available
Poor Android support
Linux comes with no desktop manager
Poor community support
Not the best choice for hobbyist projects