Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: AT91SAM7S64-IAR-EK interrupt debug trouble
PostPosted: Tue Jun 21, 2005 10:18 pm 
Offline

Joined: Tue May 17, 2005 5:59 pm
Posts: 13
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


Last edited by gary on Wed Jun 22, 2005 5:10 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 10:48 pm 
Offline

Joined: Thu Jun 02, 2005 10:18 am
Posts: 29
Thank you so much. Saved me alot of hassle 8)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 2:00 pm 
Offline

Joined: Wed Jul 20, 2005 11:58 am
Posts: 3
Location: Italy
Thank you Gary. I had the same problem.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 10:14 am 
Offline

Joined: Sat Jan 07, 2006 7:42 pm
Posts: 2
Thank you, Gary. I work with a new AT91SAM7S-EK and have exactly the problems you describe. I tried all your solutions, but nothing works...
???????


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 2:37 pm 
Offline

Joined: Sat Mar 18, 2006 10:05 pm
Posts: 37
I am having the exact same problems. But I cant find your attached files in this forum.... how to get them? Are they deleted here for some reason?

Anyway: I tried editing away all lines with AIC_IVR in them in the mentioned file, but that changed nothing....

_________________
/PM


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 11:04 pm 
Offline

Joined: Sat Mar 18, 2006 10:05 pm
Posts: 37
I talked to IAR about this problem, but they seems to not know about it anymore.... Could anyone else with the j-link/IAR kit please try to set a breakpoint inside one of the interrupt handling routines in the interrupt example code...? Tell me if it works for you!

For me, I never reach that breakpoint...

_________________
/PM


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 30, 2006 3:36 pm 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
pmazolo wrote:
I talked to IAR about this problem, but they seems to not know about it anymore.... Could anyone else with the j-link/IAR kit please try to set a breakpoint inside one of the interrupt handling routines in the interrupt example code...? Tell me if it works for you!

For me, I never reach that breakpoint...

take a look at this thread:
http://www.at91.com/www/phpBB2_mirror/v ... rupt+debug

this solved the problems i had with debugging.

regards
gerhard


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: