HowTo Olimex SAM9-L9260 + OpenOCD + Olimex arm-usb-tiny

Hello :slight_smile:

I am working on the [Free/Open Digital Audio Player with name Rockbox Player.

We are using the Olimex SAM9-L9260 development board which have the AT91SAM9260 MCU. I bought the Olimex arm-usb-tiny JTAG hardware to make debug…

I would like to get help in making debug, mainly get a script for OpenOCD, to download code to SDRAM and debug it. I am using Eclipse IDE on GNU Linux Ubuntu, I would like to debug using this tools.

Until now I just got the arm-usb-tiny JTAG detected and working with the script arm-usb-tiny.cfg, [here.

I had read a few tutorials about using this tools to debug ARM, however I couldn’t find a working scripts and examples for this development board / MCU. I would apreciate any help, even if not to use this tools, as every information can help me, helping our project.

Thanks in advance.](Google Code Archive - Long-term storage for Google Code Project Hosting.)](RockboxPlayer < Main < Wiki)

Hello :slight_smile:

I am answering to my own question since I resolved it, and I hope to help someone with the same question :slight_smile: here is a screenshot of a debug on Eclipse:

http://farm4.static.flickr.com/3163/310 … 4f18_o.png

HowTo Install OpenOCD:

Actual scripts works with OpenOCD revision 732, so we get and build that revision:

svn checkout -r 732 svn://svn.berlios.de/openocd/trunk

We need to enable “ft2232_libftdi” because JTAG ARM-USB-TINY uses it. We may need to install libftdi using apt-get.

cd trunk

./bootstrap

./configure --enable-ft2232_libftdi

make

make install

OpenOCD is now installed and finally we can run it doing:

openocd -f interface/arm-usb-tiny.cfg -f target/at91sam9260.cfg

More information here:

http://code.google.com/p/rockboxplayer/ … enocd_r732

http://code.google.com/p/rockboxplayer/ … gUsingJtag

http://code.google.com/p/rockboxplayer/ … nmentSetup

Good work.

Looks like you are using Ubuntu there :wink:

fordp:
Good work.

Looks like you are using Ubuntu there :wink:

Yes!! Always using Free Software, if possible. Here are more 2 images:

Showing the disassembly window, we can do step running the code or in C code or assembly, is great!!!

http://farm4.static.flickr.com/3231/310 … fc10_o.png

Showing the ARM registers, in this case the PC (Program Counter) is at yellow because it changed since last time:

http://farm4.static.flickr.com/3074/310 … 7cbc_o.png

casainho,

I am trying to run the same project as you are, the getting started one. I can build the project and run openOCD, but when i try to debug, i get a “Launch failed. Binary not found.” error.

any ideas?

I’m new to the Eclipse IDE so I’m basically starting from scratch and any help would be very welcomed. Thanks!

Colton

Aggielectronics:
casainho,

I am trying to run the same project as you are, the getting started one. I can build the project and run openOCD, but when i try to debug, i get a “Launch failed. Binary not found.” error.

any ideas?

I’m new to the Eclipse IDE so I’m basically starting from scratch and any help would be very welcomed. Thanks!

Colton

I am debugging a lot!! I am also starting with ARM7, using the same tools :slight_smile:

Don’t forget to read the tutorial from Mr. James P. Lynch!!! Here:

http://code.google.com/p/rockboxplayer/ … ingStarted

I got it past that error!

but…of course now i’ve hit another wall. lol

its giving me the error “cannot write to memory” at the first memory location pointed to in the sdram_init.gdb file. it says its a bad command file, but its the one given by atmel.

any ideas?

Aggielectronics:
I got it past that error!

but…of course now i’ve hit another wall. lol

its giving me the error “cannot write to memory” at the first memory location pointed to in the sdram_init.gdb file. it says its a bad command file, but its the one given by atmel.

any ideas?

You have to read about OpenOCD commands… I know that there is a lot of examples online that are not updated, I use an old revision of OpenOCD because the scripts I have use commands from that old revision.

You know, you can just use the same scritps we are using (download on our SVN) and follow all that information…

Good luck :slight_smile:

First off, thanks for the responses and help, im sure youre busy and all.

I tried using the scripts from the rockboxplayer code index on google, and i think it might be a problem with my openOCD rev when i get the error

target.c:1517 handle_target_script_command(): unknown event type: 'post_reset

so its not ever running the scripts. im thinking about just putting them together in one script and keeping the default line in there:

target_script 0 reset

I think when i get past that i might be on the road to victory…

but prob not lol :?

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://svn.berlios.de/openocd/trunk

We need to enable “ft2232_libftdi” because JTAG ARM-USB-TINY uses it. We may need to install libftdi using apt-get.

cd trunk

./bootstrap

./configure --enable-ft2232_libftdi

make

make install

http://code.google.com/p/rockboxplayer/ … nmentSetup

Thanks a lot casainho for all of your patience and help, and I’m proud to say that I have mastered the Eclipse configuration/debugging scheme for now lol

Ive been successfully programming my board for the past two days, and even linked in some more stuff, and everything is going pretty smoothly.

Now we’ll just see what happens when I try to flash lol

Thanks a lot man 8)

Aggielectronics:
Thanks a lot casainho for all of your patience and help, and I’m proud to say that I have mastered the Eclipse configuration/debugging scheme for now lol

Ive been successfully programming my board for the past two days, and even linked in some more stuff, and everything is going pretty smoothly.

Now we’ll just see what happens when I try to flash lol

Thanks a lot man 8)

To flash what? – I use Sam-ba on GNU/Linux from Atmel to flash the DataFlash and NAND flash memories…

The NAND flash on board. I’ve read a little on the SAM-BA utility from Atmel but not a lot. Is that the way you would suggest? And also, about the Linux loaded in the NAND flash, is it safe to just flash over it? or how do I delete it?

Aggielectronics:
The NAND flash on board. I’ve read a little on the SAM-BA utility from Atmel but not a lot. Is that the way you would suggest? And also, about the Linux loaded in the NAND flash, is it safe to just flash over it? or how do I delete it?

I used Sam-ba to remove and flash again the GNU/Linux from Nand. Also flashed Bootstrap on DataFlash with Sam-ba.

When I try to run SAM-BA it can’t find my ARM-USB-OCD interface. Is it not compatible with SAM-BA? I’ve been reading on the internet and I can’t find anywhere telling whether or not you can flash the board with the ARM-USB-OCD JTAG interface via SAM-BA.

How are you flashing your board with SAM-BA? Straight to it with a USB cable? Or with the USB tiny?

Aggielectronics:
When I try to run SAM-BA it can’t find my ARM-USB-OCD interface. Is it not compatible with SAM-BA? I’ve been reading on the internet and I can’t find anywhere telling whether or not you can flash the board with the ARM-USB-OCD JTAG interface via SAM-BA.

How are you flashing your board with SAM-BA? Straight to it with a USB cable? Or with the USB tiny?

You should read Atmel docs about Sam-ba. I use USB connection for Sam-ba - NOT JTAG!!

Yeah, I read the app notes and everything for it, and I have SAM-BA running over USB now. I can view the memory and upload files and check them against memory and enable the nandflash and all the options it gives me.

My one problem is that I cant get my program to run out of flash. It seems to me like I’m missing some sort of boot file that tells it to run my program on startup. There is the “send boot file” option on the nandflash tab, but when i try to upload my code using that, it says “Unauthorized Boot File Size”

I went over your documentation online for the rockboxplayer and saw that you had many tcl scripts there. I looked over these and figured that some or most of them were probably what SAM-BA is already running?

I am stuck at the moment trying to get my program to run out of nandflash.

Any idea on what the hold up is? I have the BMS jumper low too to boot from flash, I cant see the issue other than it being some sort of boot code I need. :?

Aggielectronics:
Yeah, I read the app notes and everything for it, and I have SAM-BA running over USB now. I can view the memory and upload files and check them against memory and enable the nandflash and all the options it gives me.

My one problem is that I cant get my program to run out of flash. It seems to me like I’m missing some sort of boot file that tells it to run my program on startup. There is the “send boot file” option on the nandflash tab, but when i try to upload my code using that, it says “Unauthorized Boot File Size”

I went over your documentation online for the rockboxplayer and saw that you had many tcl scripts there. I looked over these and figured that some or most of them were probably what SAM-BA is already running?

I am stuck at the moment trying to get my program to run out of nandflash.

Any idea on what the hold up is? I have the BMS jumper low too to boot from flash, I cant see the issue other than it being some sort of boot code I need. :?

Ok, so you did well on reading the docs.

There is some custom code on our project, but it uses Sam-ba!! I was able to flash Bootstrap code and right after the “getting_started” example. The bootstrap correctly load and jumps to the “getting_started” example.

On this days, I am just using the JTAG to load code on SDRAM and run/debug it, but I have the Bootstrap code tested and in the end I will put it working.

I would try the “getting_started” example on DataFlash.