SAM9-L9260 Hacking

From Hive76 Wiki
Revision as of 23:00, 13 December 2009 by FarMcKon (talk | contribs)
Jump to: navigation, search

A couple of SAM9 Boards are around the space (see for spec's). Here is how to setup for them.

Setup dev machine (Linux)

We have attempted setup on OSX and on Windows. In both cases, it was hard to get the project working. So instead we are working with Linux (Ubuntu 9.04) for our development.

  • Install Ubuntu

Bootloader (SAM)

1) The first thing to check is your bootloader, to make sure you can load code onto the board. 2) Download the bootloader (called SAM-BA) from the Atmel website, as part of the sam-ba_cdc_2.9.linux_cdc CD. That CD contains the linux tools for general Atmel ARM development. 3) Download some pre-built projects to test. You can download a CD image with a bunch of prebuilt projects from Atmel called at91sam9260-ek That disk will contain a directory 'packages' which is full of pre-built example projects, including the completed binaries. 4) Connecting to the board via SAM-BA is annoyingly complicated, and a bit wonky. It's bad bad design, and took a bit to figure out. To make a long process short, you have to munge the 'usbserial' kernel module. That means you need to unload it if it's loaded, reload it with some custom settings, and then check it connected ok. Details on the computer side of that process are at For the board itself (the Olimex SAM9-L9260) you will also have to pull a couple of jumpers to get the programmer to connect properly. Unplug the board from the computer, and from the wall, and pull off jumper DF_E and jumper NAND_E. AFAIK (check this) that prevents the board from booting from flash or NAND flash, and it will default to a reprorgamming mode. (insert photo) While those jumpers are removed, plug power into the board, and connect the USB cable from your computer to the SAM9-L9260 board. If you then run SAM-BA (having done 1 - 4) you should see the board listed as You can see how to setup OLD VERSION BELOW:



1) Give up on OSX. IT won't work properly, I tried. Well, you can try too, but I found another way... 2) Load linux on your mac. Rock on! 3) Download ' (Linux - v1.13 current release) (7 MB, revision 1.13, updated 6/09)' from 4) Unzip that package somewhere helpful. Connect your USB -> Serial connector , and connect your serial to the board. 5) run lsusb, and look for 'Bus 004 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port' 5) if that exists, go into the SAM-BA directory, and run ./sam-ba. You should be able to select /dev/ttyUSB0 and connect to it.

Linux Development Enviroment setup

(for Gentoo (Gentoo) Gentoo Crossdev works. See 1) download rockbox source "svn co svn:// rockbox_tools" 2) run 'rockbox_tools/' it will ask for a target, select arm as your target by pressing 'a' when prompted.

Setup GDB tools :

lovingly based on 1) sudo apt-get install libncurses5-dev 2) Build GDB for arm-elf manually (it sees there is no package for it?)

 a) download GDB via 'wget'
 b) unpack via 'tar -xvvf gdb-6.8.tar.bz2'
 c) move into gdb 'cd gdb-6.8'
 d) configure gdb './configure --target=arm-elf  --prefix=/usr/local/arm-elf --disable-werror'
 e) build via 'make' and install via 'make install'

3) When build is done, edit .bashrc so that it includes PATH=$PATH:/usr/local/arm-elf/bin 4) get the lyre project source code (as test/reference for SAM9

can be fetched via 'hg clone lyre_src'

Install OpenOCD

We are using ARM-USB-TINY JTAG hardware but others JTAG hardware should work on a similar way if supported by OpenOCD. Actual scripts works with OpenOCD revision 732, so we get and build that revision: svn checkout -r 732 svn:// (testing svn checkout svn:// We need to enable "ft2232_libftdi" because JTAG ARM-USB-TINY uses it. We may need to install "libftdi dev" using apt-get.

 cd trunk
 sudo apt-get-install automake
 sudo apt-get install libtool
 sudo apt-get install libftdi1
 sudo apt-get install libftdi-dev
 sudo apt-get install texinfo
 ./configure --enable-ft2232_libftdi
 make ins

next: follow