OLIMEX SAM9-L9261 User Guide

SAM9-L9261
User Manual
All boards produced by Olimex are ROHS compliant
Rev.A, October 2008
Copyright(c) 2008, OLIMEX Ltd, All rights reserved
INTRODUCTION:
SAM9-L9261 is a development platform with ARM9 microcontroller, TFT LCD 3.5" 320x240 pixels with TOUCHSCREEN, 64MB SDRAM and 512MB NAND Flash. The board has Ethernet 100Mbit controller, USB host, USB device, RS232 and 20 pin extension port with unused SAM9261 GPIO ports available for add-on boards. SAM9-L9261 has waste amount of Flash and RAM and runs a 2.6.27.4 Linux. RTC clock is backed up with 3V Li battery.
FEATURES:
- MCU: AT91SAM9261 16/32 bit ARM9™ 200MHz operation.
- Standard JTAG connector with ARM 2x10 pin layout for programming/ debugging with ARM-JTAG.
- TFT LCD 3.5" 320x240 pixels with TOUCH SCREEN supported by Linux framebuffer.
- 64 MB SDRAM.
- 2MB Dataflash used to store bootloaders and the Linux kernel.
- 512MB NAND Flash (seen in Linux as silicon drive).
- Ethernet 100Mbit connector.
- USB host and USB device connectors.
- RS232 interface and drivers.
- SD/MMC/Dataflash card connector.
- AT73C213 stereo DAC with Linux ALSA drivers.
- Four user buttons and one reset button.
- Three status LEDs.
- On board voltage regulator 3.3V with up to 800mA current.
- Single power supply: regulated 5V DC required.
- Power supply filtering capacitor.
- 18.432 Mhz crystal.
- PCB: FR-4, 1.5 mm (0,062"), soldermask, silkscreen component print.
- Dimensions: 100 x 80 mm (3.94 x 3.15").
ELECTROSTATIC WARNING:
REQUIREMENTS:
Cables:
1.8 meter USB A-B cable (needed for restoring the installation).
NULL-modem RS232 cable (needed for the Linux console).
UTP LAN cable (needed for connecting SAM9-L9261 to Internet).
Power Supply:
Regulated 5V DC power supply, capable of supplying at least 1A.
SCHEMATIC
GETTING STARTED
passwd
TOOLCHAIN
is provided that contains the Codesourcery binaries along with some useful shell scripts. This tarball must be extracted in user's home directory. Example:
# cd $HOME
# tar xzf codesourcery-toolchain-2008q1-repack.tgz
The latter will create a directory
$HOME/bin/codesourcery-armgcc-2008q1
along with some shell scripts that must be sourced before compilation:
# source $HOME/bin/linux_cross_compile.sourceme
# source $HOME/bin/bootloader_cross_compile.sourceme
BOOT LOADERS
The SAM9-L9261 board requires a three-stage boot loader before booting the Linux kernel.
RomBOOT -> at91bootstrap -> u-boot -> Linux kernel
(internal ROM) (dataflash) (dataflash) (dataflash)
AT91BOOTSTRAP
Version 2.4 of at91bootstrap has been used, along with minor modifications to add support for the SAM9-L9261 board. To compile from source:
Extract the sources:
tar xzf at91bootstrap-2.4-olimex.tgz cd at91bootstrap-2.4-olimex
Setup the environment:
source $HOME/bin/bootloader_cross_compile.sourceme
Configure at91bootstrap for SAM9-L9261
make sam9_l9261_defconfig
Compile:
make
The resulting binary is created in:
binaries/sam9_l9261-dataflashboot-2.4.bin
WARNING: Due to AT91SAM9261 chip errata booting from NAND flash is
not supported.
U-BOOT
Extract the sources:
tar xzf u-boot-git20081013-olimex.tgz cd u-boot
Setup the environment:
source $HOME/bin/bootloader_cross_compile.sourceme
Configure at91bootstrap for SAM9-L9261:
make sam9_l9261_config
Compile:
make
The resulting binary is created in the main sources directory:
./u-boot.bin
WARNING: The needed image is "u-boot.bin". The "u-boot" file is an ELF file
that cannot be directly written into dataflash!
LINUX KERNEL
The used kernel is a mainstream 2.6.27.4 slightly modified to include support for the SAM9-L9261 board. As with the bootloaders, the modifications were based on the source files for Atmel's AT91SAM9261EK board.
In order to compile the kernel its sources must be extracted first:
tar xzf linux-2.6.27.4-olimex.tgz
Then setup the needed environment variables:
source $HOME/bin/linux_cross_compile.sourceme
Go to the source directory:
cd linux-2.6.27.4-olimex
Load the default configuration for the SAM9-L9261 board:
make sam9_l9261_defconfig
Optionally, you can tweak the kernel compile-time configuration:
make xconfig
And finally you can compile it:
make uImage
If compilation is successful, the resulting kernel image can be found in:
linux-2.6.27.4-olimex/arch/arm/boot/uImage
NOTE: The linux-2.6.27.4-olimex.tgz archive is pre-patched and ready for
compilation. The file linux-2.6.27.4-olimex.patch.gz, found in the src
TWEAKING THE KERNEL
We welcome any patches and comments for improving the board support for SAM9-L9261. The starting point for board-specific initialization is the following file:
arch/arm/mach-at91/board-sam9-l9261.c
Additional AT91SAM9261 chip specific initialization is located at:
arch/arm/mach-at91/at91sam9261.c arch/arm/mach-at91/at91sam9261_devices.c
ROOT FILESYSTEM
The root filesystem can be built using http://www.angstrom­distribution.org . The other option is to use a ready-made binary distribution like Debian or some pre-compiled Angstrom image. The root filesystem used in SAM9-L9261 is a slightly modified version of the official Atmel Linux demo binary.
Additional software can easily be installed by the command "ipkg", provided that the board is connected to Internet via Ethernet cable. Run
ipkg
from the SAM9-L9261 shell prompt to see the available options.
RUNNING USER-COMPILED BOOTLOADERS AND LINUX KERNEL
1. Extract the contents of the sam9-l9261-samba.zip archive .
2. Overwrite the binary files with the newly compiled ones.
3. Run the installation restoration procedure below.
RESTORING THE INSTALLATION
Restoration procedure:
1. Make sure AT91-ISP v1.12 or higher is installed. It is freely available
from http://www.atmel.com/products/at91.
2. Power down the board.
3. Remove the AT/SD jumper.
4. Power up the board.
5. Connect the PC host to the board USB device connector.
6. Put the AT/SD jumper at the AT position.
7. Windows might ask for drivers. Select automatic driver installation.
Windows should find the necessary drivers from the previous AT91­ISP installation.
8. Extract the contents of the sam9-l9261-samba.zip archive to a
temporary directory.
9. Run the sam9_l9261_demo_linux.bat script from that directory.
10. After a couple of minutes Notepad will be opened with the log file of
the write operation.
11. Reset or power cycle SAM9-L9261.
WARNING: All memory contents will be ERASED, including any data stored
in the NAND partition.
.....lots of TCL code......
puts "-I- === Load the Kernel image ===" send_file {DataFlash AT45DB/DCB} "$df_mapping(kernelFileName)" $df_mapping(kernelOff) 0
#puts "-I- === Initialize the NAND access ===" #NANDFLASH::Init
#puts "-I- === Erase all the NAND flash blocs and test the erasing ===" #NANDFLASH::EraseAllNandFlash
#puts "-I- === Load the linux file system ===" #send_file {NandFlash} "$nf_mapping(diskFileName)" $nf_mapping(diskOff) 0
LEDS
The board has three user-controllable LEDs. The default Linux configuration for these is:
LED # Configuration Description
LED1 nand-disk LED is switched on on every access to the
NAND flash.
LED2 none No function assigned.
LED3 heartbeat Repeatedly switched on and off following the
distinctive heartbeat pattern.
LEDs can be manually controlled from the Linux shell prompt. For example, to switch on LED2:
echo 255 > /sys/class/leds/led2/brightness
And to switch it off:
echo 0 > /sys/class/leds/led2/brightness
EXTENSION PORT
AT91
PIO
Directory name
under /sys/class/gpio
EXT
pin#
Notes
-- -- 1
+3.3V
-- -- 2
GND
PA7 gpio-ext8 8
PA8 gpio-ext9 9
PB4 gpio-ext10 10
PB30 gpio-ext11 11
PC3 gpio-ext12 12
PC4 gpio-ext13 13
Not available when SD/MMC is enabled
PC5 gpio-ext14 14
PC6 gpio-ext15 15
PC7 gpio-ext16 16
Not available when SD/MMC is enabled
PC12 gpio-ext17 17
PC13 gpio-ext18 18
-- -- 19
+5V
-- -- 20
GND
echo high > /sys/class/gpio/gpio-ext8/direction echo in > /sys/class/gpio/gpio-ext10/direction
Outputs can be controlled by writing to the value file like this:
echo 0 > /sys/class/gpio/gpio-ext8/value echo 1 > /sys/class/gpio/gpio-ext8/value
cat /sys/class/gpio/gpio-ext8/value cat /sys/class/gpio/gpio-ext10/value
Of course user is free to write a C program to access these files instead of using the shell examples above.
JTAG PORT
Pin # Signal Name Pin # Signal Name
1 VCC 2 VCC
3 ICE_NTRST 4 GND
5 TDI 6 GND
7 TMS 8 GND
9 TCK 10 GND
11 RTCK 12 GND
13 TDO 14 GND
15 ICE_NRST 16 GND
17 NC 18 GND
19 NC 20 GND
PLAYING MULTIMEDIA
The default installation includes a command-line multimedia player. To play audio or video start the media player giving the media files as command line arguments:
mplayer song1.ogg
mplayer myvideo.avi
alsamixer
mplayer -ao alsa song1.ogg
USING THE SD/MMC SLOT
A few limitations arise when using the SD/MMC slot:
1. AT73C213 sound cannot work in Linux.
2. ADS7843 touchscreen cannot work in Linux.
3. Generic SPI cannot work in Linux.
4. Before and during booting the jumper AT/SD must be in position
“AT”. After Linux kernel is loaded and running, this jumper must be placed at the “SD” position.
5. The SMD jumpers WP_E and CP_E must be soldiered.
6. A specially configured version of the Linux kernel must be used. A
precompiled binary can be found in the “sam9-l9261-samba­sdmmc.zip” archive. The configuration for this kernel can be loaded
in the kernel source tree with the following command
make sam9_l9261_sdmmc_defconfig
CAVEAT: The AT91SAM9261 MCI controller has a few bugs which can
prevent it from working properly with some SD/MMC cards. Please consult the chip errata for more information.
COMPILING USER APPLICATIONS FOR EMBEDDED LINUX
The subdirectory linuxapp-testprj has two simple projects that show how to cross-compile user applications for Linux. The fbtest.tgz archive contains an example that draws the frame buffer from user space. The evtest.tgz archive contains an example how to access the board buttons.
TIPS AND TRICKS
TIP: The original Angstrom root filesystem distribution does not enable the
vi /etc/network/interfaces
and add the following line:
auto eth0
SPACE or ENTER to enter the U-Boot shell:
Hit any key to stop autoboot: 0 U-Boot>
U-Boot> setenv bootargs console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.0.225:/path/to/nfs-root/ ip=192.168.0.239:192.168.0.225::255.255.255.0:emblin::none
And finally boot the kernel:
U-Boot> boot
TIP: After creating a root filesystem using buildroot, Angstrom or similar
mkfs.jffs2 --root="sam9-rootfs" -e128KiB -n -p -o"angstrom-x11-image­demo-glibc-at91.rootfs.jffs2"
automatic IP configuration. This can be changed by editing the file /etc/network/interfaces.
order to use it, however, the root password must be set. Type as root in board terminal:
passwd
setenv ethaddr 00-40-91-31-32-33
And then save the settings to dataflash:
saveenv
Another option is to open the programming script
sam9-l9261-samba/sam9_l9261_demo_linux.tcl
REFERENCES
http://www.atmel.com/products/at91
http://www.linux4sam.org
http://www.at91.com
http://www.codesourcery.com
http://www.kernel.org
http://maxim.org.za/at91_26.html
http://u-boot.sourceforge.net
http://www.angstrom-distribution.org
ORDER CODE:
SAM9-L9261 – assembled and tested (no kit, no soldering required)
How to order? You can order to us directly or by any of our distributors.
Check our web www.olimex.com/dev for more info.
Revision history:
REV.A - created October 2008
Disclaimer:
© 2008 Olimex Ltd. All rights reserved. Olimex®, logo and combinations thereof, are registered trademarks of Olimex Ltd. Other terms and product names may be trademarks of others.
The information in this document is provided in connection with Olimex products. No license, express or implied or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Olimex products.
Neither the whole nor any part of the information contained in or the product described in this document may be adapted or reproduced in any material from except with the prior written permission of the copyright holder.
The product described in this document is subject to continuous development and improvements. All particulars of the product and its use contained in this document are given by OLIMEX in good faith. However all warranties implied or expressed including but not limited to implied warranties of merchantability or fitness for purpose are excluded.
This document is intended only to assist the reader in the use of the product. OLIMEX Ltd. shall not be liable for any loss or damage arising from the use of any information in this document or any error or omission in such information or any incorrect use of the product.
Loading...