RoadTest: Atmel SAM-4S Xplained Evaluation Kit
Author: mconners
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?: Maple Ret6, multiple NXP LPC boards, NXP LPC4330-Xplorer, Multiple Arduini, Raspberry Pi, BeagleBone, others
What were the biggest problems encountered?: Not really problems, but better linux support would be appreciated. I was able to get the board to work well under linux, but I had to work for it.
Detailed Review:
Unboxing
When I received the 4S Xplained package in the mail I was initially impressed with the packaging. Anti-static bag, foam, hard plastic case, cardboard box, shrink wrap, packing material, Newark box. I guess they wanted to make sure it didn’t get broken.
Once I got through all the packaging, I found the board and a USB cable. There was no sign of the welcome letter mentioned in the description.
Research
I went to the sites listed in the description of the Road Test (http://www.atmel.no/webdoc/sam4s16xplained/sam4s16xplained.html and http://www.atmel.com/products/microcontrollers/arm/sam4s.aspx) and started reading about the board. I plugged the board into the usb cable and observed the pre-programmed firmware illuminate the two user leds and ran my finger across the built in touchpad which changed the blink speed of the leds. I ran my finger the other way down the touchpad and the leds were restored to their original state.
My goal with many of these boards is to see the degree of difficulty involved in using them in a linux environment. While I was a digital hardware designer many years ago, I changed with the industry and eventually became a full time software developer. My bare metal hardware and software exposure is limited to a hobby at this time so I approach this with a hobbyists budget and tend to lean towards open source solutions or solutions that can be executed in an open source environment. Linux is my preferred platform although I do have a copy of Win XP that I run in Virtual Box.
Programming
I downloaded the Atmel Software Framework v 3.5.1 (http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx) and unzipped the archive. Inspecting the package I found that everything was there for gcc and make. I had previously installed arm cross compiler packages on my system and I was very pleased to discover that changing into the gcc directories in each of the packages and typing make on the command line was adequate to build the example programs. I located the source for the sample firmware, altered the code to only illuminate one of the leds, and rebuilt the package using make. This way if I was able to flash the board I would know that it was my altered code and not the pre loaded firmware. Now to learn how to flash the board.
exec device = AT91SAM4S16C
loadbin sam4s_xplained_qtouch_demo_flash.bin 0
verifybin sam4s_xplained_qtouch_demo_flash.bin 0
r
g
exec device sets the JLink software to use the appropriate device
loadbin loads the binary file into flash at the address specified, in this case 0, the beginning of flash
verifybin validates that the data loaded into memory matches the file on disk
r resets the board
g is go, or execute
Voila, it worked, only one led lit up and when touching the slider the one led behaved as before.
I undid my code changes, recompiled, reflashed the device, all was back as I received the board, both leds functioning. I was then able to write a script that piped the commands into the StartJLinkExe.sh taking a bin filename as an argument and I was able to program the board entirely from the command line with no interaction. I simply needed to add an exit command after the g command and when the board was finished programming control was returned to the command line.
I looked through the rest of the sample code directories and found another interesting sample adc_temp_sensor_example.c, this routes the internal temperature sensor built into the SAM4S to one of the ADC lines and prints the output to the UART available via USB. This time I decided to try in Eclipse. I had previously installed and configured a cross compiling version of Eclipse on my system, so I just needed to bring that up, load up a Makefile project with existing source, point it to the proper directory and was able to build right away. I followed the same procedure for flashing the board, executed screen 115200 /dev/ttyACM0 and the terminal started printing out the temperature in degrees celsius.
I finally broke down and decided to see how the other half lives. I fired up my XP virtual box and installed Atmel Studio. This tool is distributed for free by Atmel and is built on top of Microsoft’s Visual Studio. Atmel Studio is well done and definitely makes developing for the Atmel platforms much easier. There are code wizards and direct downloads of examples and importation of drivers and many other features that assist the developer in creating software for this platform. I will definitely give them high marks for developing such a useful tool. I would, however, like to see them work with Code Red or another vendor to come up with something that works on more platforms.
So as far as development goes, it’s possible to use this board under linux, and I presume Macs as well, but it is not as well supported as equivalent boards from NXP using Code Red’s LPCXpresso. The Windows support is excellent, but since I am not a regular Windows user, it’s a bit of a turn off for me.
The Chip
The heart of this board is the Atmel ATSAM4S16C, a 32 bit Arm Cortex M4. It features a Max operating speed of 120 MHz, 1 MB of Flash, and 128 KB of SRAM. It has an external bus supporting SRAM, PSRAM, NOR Flash. LCD Module, and NAND Flash. A significan Peripheral set for system control and analog interfacing and is pin-pin compatible with SAM7S, SAM3N, and SAM3S MCU's. It comes in a 100 pin package in various configurations, up to 79 I/O pins and can support up to 79 external interrupts.
The Board
As mentioned earlier the board has a touch slider, 2 user leds, and a temperature sensor tied to one of the built in Analog to Digital converters. In addition it has a user push button, a reset push button, a USB device, an external (not built in) SRAM chip, built in JTAG (JLink) debugger available via USB, and 4 IO expansion headers exposing 2 SPI ports with separate CS lines, Two Wire interface, UART RX and TX data, 11 ADCs, 1 DAC, and 7 PWM outputs. I’ve probably missed some.
Conclusion
For the price it is a very capable board with quite bit to offer. It’s slightly more expensive than a Raspberry Pi, slightly less expensive than an Arduino Due. If you are purchasing this board to familiarize yourself specifically with the Atmel SAM4S I don’t think you can go wrong. If you are looking for a board to experiment with and do some bare metal programming while learning about Arm, there are cheaper options, such as ST Discovery Series, and the previously mentioned NXP LPC series of boards. But being that I now own one of these boards I will definitely consider using it on one of my upcoming projects. With the multiple exposed ADCs I can see it being connected to some temperature sensors and some outputs being connected to relays and somehow finding its way into my homebrewing (beer) hobby.
Thanks to Atmel and Element 14 for making this possible.