I am developing an AT91SAM7S64 project using the IAR Kickstart and J-Link cable from the kit. I have had no problems with my C application software, until it was time to debug interrupts.
EDITED TO UPDATE FINDINGS
I modeled my interrupt handling after the auto-extract ZIP file AT91SAM7S64-Interrupt-IAR4_11A-1_0.zip on the AT91 CD-ROM in the kit. I discovered that debugging the interrupts had numerous problems.
Wondering how the example project in the ZIP file performed, I extracted all files, built that project and ran the IAR C-Spy debugger through the J-Link cable, connected to the board from the kit. The example program does not seem to work properly. The LED pattern is erratic, Holding down switch SW3 (the example PIO interrupt) doesn't have an obvious effect. When I set a breakpoint in the PIO interrupt handler, the breakpoint was never reached.
After seeing reports of similar problems in the Yahoo AT91SAM7 group
http://groups.yahoo.com/group/at91SAM7 I learned that the IAR Kickstart EWARM V4.11 (that comes with the AT91SAM764-IAR-EK kit) has known problems debugging in protected mode.
IAR has an updated v 4.20 Kickstart available that fixes the protected mode debugging of interrupts. It can be downloaded at this link which requires registration:
http://wwwjobb4.iar.se/Download/SW/?item=EWARM-KS32
FURTHER UPDATE
I spoke with a very helpful applications engineer at IAR. He said the problem occurs when the debugger accesses the AIC_IVR register before it goes into Protected mode. When this occurs, the way the sample code is written you will get one interrupt (at best) and then it locks up. It is then necessary to power down the board and start over again. He mentioned it is necessary to wait a while for the device to reinitialize properly, This matches my experience -- I was powering-down and restarting the app and debugger as a workaround.
He said there are two possible solutions to this problem.
Replace the MAIN.C file in the sample program
He sent me the attached MAIN.C by email. This corrects the problem. If the user program carefully follows this example, it should work correctly.
For the Atmel example, the MAIN.C file usually goes in:
\Program Files\IAR Systems\Embedded Workbench 4.0\
arm\src\examples\Atmel\SAM7S64\AT91SAM7S64-Interrupt-IAR\
AT91SAM7S-Interrupt\Src
Modify the Debugger so it doesn't access the AIC_IVR register
This means the user cannot see the register contents when execution is stopped, but this may be an acceptable compromise. In this case, the programmer need not rigorously follow the example because the interrpt debug problem simply cannot occur.
To do so, he provided a modified debugger definition file with the AIC_IVR register access commented-out. The file ioat91sam7s64.ddf usually goes in:
\Program Files\IAR Systems\Embedded Workbench 4.0\arm\config
I am just trying these modifications myself...
Gary