29j04pn012
fey fun)
AVR32-NGW100
the tlesjtar
embatun
Home AVR ARM FPGA Howto Projects Links Imprint
Introduction
Originally wanted to start with my NGW100 buthad some problems to find all tho needed information. |
will have to dig around the web to collect these information and decided to create this page for all the
other beginners.
I did not invent the wheel again. This website just brings together some information which you will find at
the folowing pages:
aurfveaks forum
awrfreaks wiki
‘The AVR32 Linux project
‘ATMEL Technical Support Genter
ATMEL AVR32_
Buildroot for AVR32
‘AVR32737; AVR32 AP7 Linux Getting Started
This website is a step by step tutorial how to set up your development tools, and update a NGW100.
‘The next picture shows an overview of the NGW/100, this picture can be found at the AVRtreaks wiki and
in your local wiki running at the NGW100 too:
em Flats
MT32A77000 General
apamsion Wenders
so-care— a Dat las
Gonsrat
expansion Waders
Ritinyze
Bord Contrelter
rs2Arv900 TAS"
ASB 8
‘The tutorial below bases on Ubuntu 7.10 and Buildroot 2.1.0.
wns embafun de/avr/avr32ngu200yindex hind ano29j04pn012
wn embafun de/ai/avr32ngw20yindex hind
embatun
“ep
Linux
‘We want to use the buildroot tool. Therefore we need a real Linux operation system, where I decided to
use Ubuntu 7.10. Itied to get bullroot working on Cygwin and Mac OS X but without success. Here |
use Ununurin a VMware, this has the advantage to be able to copy the image to a Windows or Mac OS
X machine later to0, Even you can pass your image toa friend who wants to start playing with AVR32.
to0.
Download and install Ubuntu. For this tutorial here Iwill use an user avr32. Therefore create an user
‘avr32 on your machine to.
‘After you installed Ubuntu highly recommend to update your installation. Ihad some problems with the
network in my VMware, after updateing the problems were solved.
Buildroot
‘You will need the AVR32003: Buldroot for AVR32 application note. | will refer to revision 32062C-
‘AVR32-11/07, The buildroot page for ARV32 can be found at the ATMEL page.
‘To fll the requirements of the buidroot you need to install some packages which are not available on a
{resh installed Ubuntu, You can install the packages with a GUlor at the command line in a Terminal
Here Iwill use the Terminal, the syrtaxis:
sudo apt-get install
Yourmust execute the apt-get command as the superuser, therefore we need the sudo command,
Please open a Terminal and install the following packages:
‘sudo apt-get install g++
‘= sudo apt-get install bison flex autoconf gettext patch texinfo
‘+ sudo apt-get install ibncurses- Add/Remove... from the menuline of Ubuntu, The "Add/Remove
Applications" window will be opened. Here press the "Preferences" button and navigate to the "Third-
Party Software” folder. Press "+Add.."
‘tthe APT line type:
deb http:/ivww.atmel.nolavr32lubuntufeisty binary!
‘The result should looks lke:
wns embafun de/avr/avr32ngu200yindex hind ano29j04pn012
wns embafun de/avr/avr32ngu200yindex hind
embatun
(Glick inside the picture to expand)
Press the "+ Add Source” button, and the dialog should looks lke:
(Click inside the picture to expand)
Press the "Close" button ofthe “Software Source” window and follow the instruction. A new window will
‘open up, press the Reload button here. New packages information willbe loaded from the internat
‘The window will be closed automatically afterwards. Close the "Add/Remove Applications" and open a
Terminal window. Type here:
sudo apt-get update
Now we can install the "STK1000 support software" with:
sudo apt-get install stk1000bsp
‘Tris can take some minutes, depending on your internet connection speed. Now you installed the aw'32-
linux toochain, and even the tool av’32program which is needed to program the w-boot,
‘The tool avr32program willbe used to connect to @ JTAGICE mkll over USB. Everytime you use the
_avr32program you can use the sudo command, or grant access with the folowing hin from AVRtreaks
wiki. On Ubuntu the “udev” partis working, therefore create a file called “avrtools rules" in the directory
“fetcludeviules.d" with the folowing content
# Atmel JTAGICE miki
ACTION=="add", SUBSYSTEM=="usb_device", SYSFS{idVendor)=="03eb",
SYSFS{IdProduct}=="2103", GROUP="avriools", MODE="0660"
‘After adding this file you must change the access righ's to 644 of avrtools.sues, type:
sudo chmod 644 avrtools.rules
Now we must create a group avtools and add the user avr32 (which will be our user name), To create a
ew group type:
sudo addgroup avrtools.
Now add the user av32 to the group avtools, ype:
sudo adduser avr32 avrtools
‘As Imention earlier, lam working with user avrG2. you created a different user, you must use this one
for the adduser command.
lLis important to reboot your machine now. After rebooting open a Terminal and connect the
JTAGICE mklto your machine. Now we want to check if we can access the JTAGICE mkl. To check the
USB bus in general ype:
sno29j04pn012
wns embafun de/avr/avr32ngu200yindex hind
embatun
lsusb
‘Tis will ist all the devices connected to the USB bus. My rasultlooks lke:
Bus 002 Device 001: 0000:0000
Bus 001 Device 002: B 03eb:2103 Atmel Corp. JTAG ICE miki
‘The JTAGICE mkllis connected to your system, now type:
avr32program ist
the resull should looks like
STAGICE mkil
You can find the serial number of your device atthe botion of the JTAGICE mk f"aw32program ~ist"
is not working, try to use "sudo avr32program ~list’. Fthis produces the correct output, you made a
mistake with the avitools.ules, or with the group/user setting
Now we have allthe tools installed and can program the u-boot to the target.
Download u-boot
Before we can download u-boo!, we must take a look at cur MAC addresses from the network
interfaces. Therefore connect a RS232 Terminal to the NGW'100 withthe folowing parameters:
115200, 8,N 4
and connect power to the NGW100, Kyou see the folowing line from wboot
Press SPACE to abort autoboot in 1 seconds
pross space and youwillbe directed tothe u-boot prompt. Type here:
printer
hich willdisplay the environment of your NGW100, it coud look like:
tee sete
Festa
Teed ele ectulmnabats
Hamer
Ec ss 5 ae
thas -
Note the values for ethaddr and ethtaddr, you wil need these values later. Iblacked out the values
here, because Ido not want that you type in my numbers :0)
Now we are ready o play a litle with the NGW/100. You can find this information at the AVEreaks wil
to0, but forthe sake of completeness | will presentit here too.
Connect your JTAGICE mkil with the NGW100 and power the target (you must use the JTAGICE mkl,
the older version JTAGICE can not be used here). At the build machine open a Terminal and type:
avr32program erase -fofi@0
‘THis will erase the entire flash and takes some minutes. Now we can program the t-boot, therefore
‘change in the binaries/atngw100 directory and type:
avr32program program ¥ bin -vfcfi@0 u-boot bin
Tris will program the u-boot into the flash. Now we will download the filesystem by SD card inthe next
step.
sno29j04pn012
wns embafun de/avr/avr32ngu200yindex hind
embatun
Download the file system
‘You will find the information at the AVRtaaks wiki too. But will present you the way which was working
for me. Becasue | must leave the way ofthe wiki, had some problems because flash_eraseall could not
be found,
First of al, we wil prepare a SD card withthe files we have created from the buildroot step. Therefore
‘we must format the SD card with an ext2 filesystem (wiki info). nsert a SD card in your reader, and type:
at
My resut looks lke:
(Glick inside te picture to expand)
Here the SD is mounted on /media/disk. Now we wil format the SD card and create the ex2 file system,
Double check which device is your SD card, Imust use /dewsdb1 here.
sudo umount /media/disk
Sudo /sbin/e2fsck idevisdb1
sudo /sbinimkfs.ext2 idevisdb1
‘sudo mount /devisdb1 /medialdisk
Ifthe last command produced an error, ike "mount point /mediaidisk does not exist”. Remove the SD
‘card and insertit again, The system will auto mount the card for you, Now we can copy the files from the
buildroot step to our SD card. Go to /medialdisk and type:
‘sudo ep SHOMEIAVRS2/bulldrootevr3242-1.O/binaies
tng 100/rotls. avr82_nofpujt2-roat
Do not forget the dot ater -root [space]{dot], This command copies the root fle system to the SD card.
Now we must copy the usr file system fo the SD card too:
‘sudo ep SHOMEIAVR32/bulldrootovr3242-1fbinales
gw 100/rotts.avr22_nofpus2-uer
‘These two files will be copied later tothe flash of the NGW100. But the target needs a filesystem to boot
{rom SD card, therefore type:
‘aude tar xv! SHOMEIAVRS2/bulldrootavr52-2-1Oibinareslatngw 10nrootls.avr32¢
foutar
‘Tris will expand and copy the root file system to the SD card.
Now we must solve a litle chicken egg problem. The files system on the SD card will mount the us file
‘system from devimtdblocks3 which is part of the flash. But we want to use the usr file system from our
SD card. Therefore we must edit the fstab fle on the SD card now. Add a "#" In front of the
Hdevimtdolock3 line ofthe fstab. Start the editor wit
sudo gedit Imedialdiskietcifstab
‘After adding the "#, the result should now looks lke:
(Click inside te pete to sxpand)
sno29j04pn012
wns embafundefavr/avr32ngu200yindex hind
embatun
‘After saving the changes, you can close the editor. Change your position to ‘media and unmount the SD
‘card with
sudo umount imedia/disk
Now we have prepared our SD card and can goto the target. Connect a RS232 Terminal tothe target
withthe following parameters:
115200, 8,N 1
ifyou powered the target, the result wil looks tke:
ot cfs COUN > CE gatas DE - CUD
Stee Ee ot es
ete st
alle? ina ny fom Bana we ese
fit ug gtms fe naar Mra
SE gata
ay ot
Ee al
Re: Bat, wat
MELE Nett Litho
Bie i
ang z
BREESE nin
cea
ish
THis is our t-boot which we copied to the target. But it could not find a root file system. Inthe next steps
‘we will download the roousr file system to the target. [found some information in the forum and even
you can find some information on the wiki. With a mix of both Icame to my solution. Insert the SD card
and type the following at the w-boot prompt:
askenv bootemd
mmeinit; ext2load mme 0:1 0x10300000 /boot/uImage; bootm 0x10300000
‘set bootargs ‘console=ttyS0 root=/devimmeblk0pt ro rootwait=1"
boot
Now the NGW100 will boot and use the file system which we have copied to the SD card. The last output
{rom the Terminal wil looks ike:
this caps ee
Sarg HF a
Srp FE Secs ne
ltrs “hectares Rabun File stan
‘in
oa vt
Py ea tw
Now we will erase the flash and copy the new fle systems. Double check that you tye the correct mtd.
device. Otherwise itis possible that you delete your whole u-boot partition and youwill hace to start at
the beginning to flash the u-boot with the JTAGICE mkllagain. The erase procedure will ake a while, but
here youwill see some progress. The dd commands take some minutes too. I'my seen thatthe targets
hangs. Do not break the command, the prompt will return,
‘Type the following at the BusyBox
flash_eraseall devimtd3
flash_eraseall devimtd1
dd ifsirootfs.avr32_nofpu ffs2-root of=/devimtd1 bs=1024
dd ifsirootfs avr32_nofpu jffs2-usr of=/devimtd3 bs=1056
Now the rootusr fle system is fashed, and we can star the target again. But we must take a halt at the
rbot and change something of the bootcmd arguments. After the reboot boots started. you see
the line:
ino29j04pn012
wns embafun de/avr/avr32ngu200yindex hind
embatun
Press SPACE to abort autoboot in 1 seconds
Here press the space to enter u-boot. But frst we must reboot the NGW100. Therefore type at the
BusyBox
reboot
Ifyou see "Press SPACE to abort autoboot in 1 seconds" press space and you willbe directed to the u-
boot prompt. Here type the folowing:
‘setenv booted ‘fsload (bootlulmage;bootm’
Now we must save the changes, type:
‘Tis will store our changes in the fash, Now remove the SD card and boot the NGW100 with:
boot
‘The NGW100 will now boot and at the end the Terminal should look like:
at sce to etree he
eet hog sb
atric AES reat eu dats at
Stearn ttn cote ona clas
PonEnSHISEeae oot e ct AUN ocean chet
BLtieanadiet coun eM EAP IDE a
ghipaabaaclatie/atoiuaiicy aur ranaiontcsts
Fae Na (GPa elder RousiesiceDeW Eb d tr See
Pntb AURAL tbe
‘tne droeer soe Uh
EES RE tatoo asl ee
Seam 88 suru dno
Srl Faso ne
ow vo,
bo Lf? OME ee? OE Mult ll Cad
finer ator het ot ble ora
Congratulation, you successfully updated u-boot and downloaded a new rootusr file system to your
New00.
‘Oops, your network may not work, because you did not set the MAC addresses of the network
interfaces. This must be done in u-boot. Therefore restart the engine and set the MAC addresses, type
at the BusyBiox (you should know now how to stop u-boot
reboot
We want to take a look at the u-boot environment, therefore type at the boot prompt
printenv
‘The environment of my NGW'100 looks like:
Mo gute
pelpteSlaam eras wttetnett
Halsey
Festeneteaut
a
Staecoat
Ficmet sce ES bas
tea “
Here ethaddr and eth taddr are missing which represents the MAC addresses. To set these adresses.
‘ype
askenv ethaddr
ano29j04pn012 embatun
u:va:29:11:22:30
askenv ethtaddr
00:04:25:11:22:31
boot
‘The addresses | used here, are fictive, You must use your own addresses which you listed in the chapter
about the “Download woot”
Bit, fyou want to halt your NGW100, ype halt atthe BusyBox and walt fo:
System hated
Now you can power ofthe target
son
AVR32 Studio
‘AVR32 Studio is based on Eclipse which is @ Java application, Check which Java is installed on your
machine, type:
Java version
‘THis will produce here the following result
java version "1.5.0"
dij (GNU lbgc) version 4.2.4 (Ubuntu 4.2.1-Subuntus)
First of allwe will update the Java to 1.6.0, Therefore open a Terminal an type:
sudo apt-get install sun-java6-jre
This takes a while and will update your Java to 1.6.0_03. From one ofthe steps above you created a
directory called AVR32 where you placed the bulldroot b22 file, Now download the AVR32 Studio from
ATMEL and store this file in the AVR32 directory too. The AVR32 Studio can be found here. Download
the AVR32 Studio for Linux, currendy, version 1.0 of AVR32 Studio is available. You must register to
download the file
Open a Terminal and go into the AVR32 directory. Now we want to expand the AVR32 Studio, type:
unzip x avr32studio-1 0-linux.gtk x86 zip
‘Tis will oreate a new directory “avr32studio" with all the AVR32 Studio programs. Change into this new
directory To start AVRS2 Studio, type:
avr32studio
‘THis will start AVR32 Studio and you willbe asked about the workspace. The workspace is the place
where all your AVR32 Studio projects will be stored later. After you chose the workspace, the window
will look tke:
(Glick inside the picture to expand)
Now my storyis over, and you can play with your new toy.
wns embafun de/avr/avr32ngu200yindex hind sno29j04pn012 embatun
‘The tutorial on this site is licensed under a Crealive Commons Attibution
EIHEEEH 2.5 Liconse and is copyright (c) 2008 by me, Michael Fischer.
wns embafun de/avr/avr32ngu200yindex hind ono