Help debugging a SAM7S64 with ARM-JTAG/OpenOCD/Eclipse

Hello, I am a student working on a course project. I am using the Olimex SAM7S-H64 development board and ARM-JTAG emulator. I am having a difficult time using the debug capabilities of the ARM-JTAG “wigglerâ€

Just a guess, but this sounds like you compiled your code with optimization turned on. Try recompiling your project with optimisation off.

Debuggers go crazy with debugging turned on. In your makefile be sure to have the command -O0 in your compiler flags:

such as: CFLAGS = -I./ -c -fno-common -O0 -g

If this doesn’t help, contact me via my gmail address (lynch007@gmail.com) and I will send you a draft copy of a new tutorial I’ve prepared for the Atmel AT91SAM7S boards that just may help.

Cheers,

Jim Lynch

Hi Jim, thanks for your reply. I had the optimizations turned off. I think the issue was that I had too much conflicting information, most of it relating to the LPC2000 uC’s.

The draft version of the document you sent me worked like a charm. I am now able to debug my Olimex H64 board with the ARM-JTAG adapter. Thank you for all your hard work on releasing these tutorials!

Regards,

Kelly

I got a at91sam7s256, using crossstudio i was unable to upload the .elf file to the header board I have. I tried to use h-jtag but it does not seem to support the at91sam7s chips. I can flash the chip with SAM-BA but then after its flash I have to reset the chip again to flash it. What am I missing, any help would be very much appreciated.

You can program the SAM7S64 with OpenOCD. This method does not require you to reset the device like SAM-BA does. Just make sure you don’t have any locked bits.

There is a tutorial online which covers the setup: http://www.siwawi.arubi.uni-kl.de/avr_p … index.html

Scroll down to the section on SAM7S uC’s

Cheers.

Hi, I have the same problem as kstich debugging with a at91sam7s.

I have optimizations off and i have tried with insight and eclipse but doesn´t work (i can step one or two asm instructions but then it goes “crazy”)

Jim, can you mail me your draft tutorial for at91sam7s please? my email is axe_240300@hotmail.com

Thanks you very much.

Jim, can you also send me your draft tutorial for at91sam7s please ?

my email is echochang2003@yahoo.com.tw

Thanks you very much.

same thing here.

Dumarjo

The tutorial is now on the Atmel www.at91.com web site.

See my post on another thread for corrections.

The tutorial is here: http://www.at91.com/thirdparty/j_lynch/jlynch.pdf

The download materials are here:

ftp://jlynch:free@81.80.104.172/

Cheers,

Jim Lynch

P.S. Amontec has a newer download of the Eclipse\GNUARM\OpenOCD components that I provided. It is version 3.2 of Eclipse and the very latest OpenOCD. You might want to use that instead, although the result is essentially the same development system.

go to: www.amontec.com and select SDK4ARM

Hi Jim,

I have used your tutorial and think that both versions are great (Philips and Atmel). I have been having a very difficult time implementing interrupts however. I can enter the ISR once but don’t return properly. I am not sure if need to add something to the code supplied in the tutorial.

I have found a set of utilities from WinArm which I have used to enable the interrupts (interrupt_utils.c/h). I am using the lib_AT91SAM7S64.h AT91F_AIC_SetExceptionVector function to set the vectors. The function that I have written is just like a normal function with the exception of the function prototype:

void spi_pdc_irq_handler(void) attribute ((interrupt(“IRQ”)));

Any advice on how to get interrupts working?

Cheers.

Kelly

Hello

I have two suggestions to try if only one interrupt is triggered.

They are silly by I have made both.

On AT91SAM you must write something/anything to the AIC End of Interrupt

Command Register AIC_EOICR at the end of your interrupt handler.

In “lib_AT91SAM7S64.h” this is done by

AT91F_AIC_AcknowledgeIt(AT91C_BASE_AIC);

or simply

AT91C_BASE_AIC->AIC_EOICR = AT91C_BASE_AIC->AIC_EOICR;

The other extremly silly problem is when the LED does blink but so fast that

it looks like it is always on. Check with an oscilloscope or change the timer values.

Yes I have done this many times, but thats human.

/Magnus

Hi Kelly.

I kept interrupts out of my tutorials for beginners to keep things as simple as possible, maybe I should re-think that idea.

Possibly this will help. Here is a Eclipse project for the Atmel AT91SAM7s256-EK board that blinks LED1 in a main( ) idle loop and blinks LED2 via a Timer-Counter interrupt (about 10 times a second).

It’s extensively annotated; see if it helps. You can download it from here:

http://www.megaupload.com/?d=K24FPYHJ

As always, be advised that megaupload.com is not exactly family-friendly (sometimes presenting some racy advertisements - cover your eyes!).

Cheers,

Jim Lynch