EmbeddedRelated.com
Forums

Interrupt not working on Eval Board...

Started by strong_arm7s April 22, 2005

Hello,
Has anybody else experienced where Interrupts are not working on the
AT91SAM7S-EK eval board when one downloads a new version of code into
the flash via the JTAG and then running it under the debugger..
They are all ther ein the AIC module Interrupt Pending register.
I have to power down the board, repower, burn the flash with the
FREERTOS demo that I downloaded from the web, run it. Then reburn the
flash with my appliaction in order to get it working again.
The cstartup.s79 and cstartup_sam7.c are almost identicle, and I
beleive the Linkingand debugging (project) options under IAR are
identicle as well.
Thanks for the help.
Andrew



Hallo,
on my AT91SAM7-EK no interrups are working either. I use the Keil
Compiler and a JTAG-Debugger. Unfortunately no Keil-Demo with
interrupts is working. I run the code in RAM.
So far I didn't flash the board. Testing samba but without success.
I've got no idea.
If you go further on with that problem, please contact me.
(uh@uh@....)
Best regards
Uli Hansen
--- In AT91SAM7@AT91..., "strong_arm7s" <strong_arm7s@y...>
wrote:
>
> Hello,
> Has anybody else experienced where Interrupts are not working on the
> AT91SAM7S-EK eval board when one downloads a new version of code into
> the flash via the JTAG and then running it under the debugger..
> They are all ther ein the AIC module Interrupt Pending register.
> I have to power down the board, repower, burn the flash with the
> FREERTOS demo that I downloaded from the web, run it. Then reburn
the
> flash with my appliaction in order to get it working again.
> The cstartup.s79 and cstartup_sam7.c are almost identicle, and I
> beleive the Linkingand debugging (project) options under IAR are
> identicle as well.
> Thanks for the help.
> Andrew




Hello,
Interrupts are very intermitent. I have found no set way to get them
to work.. Either via flash program or running for ram. I can reset
everything and reload and sometimes it works, others it doesn't.
We finally got our specific hardware done and it is doing the same
thing. I am afraid it has something to do with the JTAG debugger.
Any help would be appreciated.
Andrew

--- In AT91SAM7@AT91..., "Uli Hansen" <uh@a...> wrote:
>
> Hallo,
> on my AT91SAM7-EK no interrups are working either. I use the Keil
> Compiler and a JTAG-Debugger. Unfortunately no Keil-Demo with
> interrupts is working. I run the code in RAM.
> So far I didn't flash the board. Testing samba but without success.
> I've got no idea.
> If you go further on with that problem, please contact me.
> (uh@a...)
> Best regards
> Uli Hansen >
> --- In AT91SAM7@AT91..., "strong_arm7s"
<strong_arm7s@y...>
> wrote:
> >
> > Hello,
> > Has anybody else experienced where Interrupts are not working on
the
> > AT91SAM7S-EK eval board when one downloads a new version of code
into
> > the flash via the JTAG and then running it under the debugger..
> > They are all ther ein the AIC module Interrupt Pending register.
> > I have to power down the board, repower, burn the flash with the
> > FREERTOS demo that I downloaded from the web, run it. Then
reburn
> the
> > flash with my appliaction in order to get it working again.
> > The cstartup.s79 and cstartup_sam7.c are almost identicle, and I
> > beleive the Linkingand debugging (project) options under IAR are
> > identicle as well.
> > Thanks for the help.
> > Andrew




Hi,
we have seen some problems around IRQ when running from RAM or Flash,
when debugger connected or not with IAR 4.11. It seems to be resolved
with IAR 4.20.
Please be sure to have IAR 4.20 and the latest patches availble from
IAR website.

Keep in touch !

Rgds.

Pat.

--- In AT91SAM7@AT91..., "strong_arm7s" <strong_arm7s@y...>
wrote:
>
> Hello,
> Interrupts are very intermitent. I have found no set way to get
them
> to work.. Either via flash program or running for ram. I can reset
> everything and reload and sometimes it works, others it doesn't.
> We finally got our specific hardware done and it is doing the same
> thing. I am afraid it has something to do with the JTAG debugger.
> Any help would be appreciated.
> Andrew
>
> --- In AT91SAM7@AT91..., "Uli Hansen" <uh@a...> wrote:
> >
> > Hallo,
> > on my AT91SAM7-EK no interrups are working either. I use the
Keil
> > Compiler and a JTAG-Debugger. Unfortunately no Keil-Demo with
> > interrupts is working. I run the code in RAM.
> > So far I didn't flash the board. Testing samba but without
success.
> > I've got no idea.
> > If you go further on with that problem, please contact me.
> > (uh@a...)
> > Best regards
> > Uli Hansen
> >
> >
> >
> > --- In AT91SAM7@AT91..., "strong_arm7s"
> <strong_arm7s@y...>
> > wrote:
> > >
> > > Hello,
> > > Has anybody else experienced where Interrupts are not working
on
> the
> > > AT91SAM7S-EK eval board when one downloads a new version of
code
> into
> > > the flash via the JTAG and then running it under the debugger..
> > > They are all ther ein the AIC module Interrupt Pending register.
> > > I have to power down the board, repower, burn the flash with
the
> > > FREERTOS demo that I downloaded from the web, run it. Then
> reburn
> > the
> > > flash with my appliaction in order to get it working again.
> > > The cstartup.s79 and cstartup_sam7.c are almost identicle, and
I
> > > beleive the Linkingand debugging (project) options under IAR
are
> > > identicle as well.
> > > Thanks for the help.
> > > Andrew



Hallo,

my Evaluation Kit is working now.
I had to do some initialization commands before debugging.

This are:

// execute peripheral reset as first command
1. AT91C_RSTC_RCR=0xA5000004

2. AT91C_CKGR_MOR=0x00000601

// 3 Setting PLL and divider:
// - div by 5 Fin = 3,6864 =(18,432 / 5)
// - Mul 25+1: Fout = 95,8464 =(3,6864 *26)
// for 96 MHz the erroe is 0.16%
// Field out NOT USED = 0
// PLLCOUNT pll startup time esrtimate at : 0.844 ms
// PLLCOUNT 28 = 0.000844 /(1/32768)
// pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) | (AT91C_CKGR_PLLCOUNT &
(28<<8)) | (AT91C_CKGR_MUL & (25<<16)));

3. AT91C_CKGR_PLLR= 0x00191C05

// 4. Selection of Master Clock and Processor Clock
// select the PLL clock divided by 2
// pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK | AT91C_PMC_PRES_CLK_2 ;
4. AT91C_PMCR_MCKR= 0x00000007

Good luck
Uli



Hello Uli,
Thanks foir the reply.
I sent this to your email, but it said your not available till the
9th. Hopefully you get this.
Did you put these lines inside the cstartup_sam7.c or are you
changing registers on cpu before you hit run on your code?
I put it in my cstartup_sam7.c code and it won't start up, gives a
processor wrong mode error message.
You help is greatly appreciated, "PROST"!! Andrew

--- In AT91SAM7@AT91..., "Uli Hansen" <uh@a...> wrote:
> Hallo,
>
> my Evaluation Kit is working now.
> I had to do some initialization commands before debugging.
>
> This are:
>
> // execute peripheral reset as first command
> 1. AT91C_RSTC_RCR=0xA5000004
>
> 2. AT91C_CKGR_MOR=0x00000601
>
> // 3 Setting PLL and divider:
> // - div by 5 Fin = 3,6864 =(18,432 / 5)
> // - Mul 25+1: Fout = 95,8464 =(3,6864 *26)
> // for 96 MHz the erroe is 0.16%
> // Field out NOT USED = 0
> // PLLCOUNT pll startup time esrtimate at : 0.844 ms
> // PLLCOUNT 28 = 0.000844 /(1/32768)
> // pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) |
(AT91C_CKGR_PLLCOUNT &
> (28<<8)) | (AT91C_CKGR_MUL & (25<<16)));
>
> 3. AT91C_CKGR_PLLR= 0x00191C05
>
> // 4. Selection of Master Clock and Processor Clock
> // select the PLL clock divided by 2
> // pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK | AT91C_PMC_PRES_CLK_2 ;
> 4. AT91C_PMCR_MCKR= 0x00000007
>
> Good luck
> Uli



Very relevant question, yes!

Should this stuff be done in a GDB ini-file,
or might it as well be entered from the C-startuproutine???
(or both ways apply??)

Is the whole idea to keep the crt0.s/cstartup.s (or whatever ...)
as 'generic' as possible -
and do all required register initialization etc.
for a particular target through the debugger?

I have the J-Link emulator pod,
and would like to use in conjunction w. GCC&GDB(Insight).
Previously, I have used GDB(Insight) w. ARM7 targets running
Angel or Redboot ROM monitors - this works, but has lots of
quirks (SWI not under application control, resource clashes +++)
The SAM7S family is not suitable for this debug method.

I have managed to start up 'jlinkserver.exe [-ram|flash] -port <nnnn>'
and attach to GDB(Insight) thru 'Remote TCP' - this seems to work fine;
download to RAM or Flash yields nothing but "success" messages.
However, trying to start up the application gives a watchdog timeout
immideately,
then "no response from target: detach from target ... ?" :-(

I'm not very familiar w. GDB's command line syntax etc.
so I would prefer to put everything in one place - the C startup module.
Anyone out there who's had success w. this??

PS: I'll accept a sample .gdbinit file also ... ;-)

Rgds
Morten > -----Original Message-----
> From: AT91SAM7@AT91...
> [mailto:AT91SAM7@AT91...] On Behalf Of strong_arm7s
> Sent: Friday, April 29, 2005 11:14 PM
> To: AT91SAM7@AT91...
> Subject: [AT91SAM7] Re: Interrupts are working now!!!!
>
> Hello Uli,
> Thanks foir the reply.
> I sent this to your email, but it said your not available
> till the 9th. Hopefully you get this.
> Did you put these lines inside the cstartup_sam7.c or are you
> changing registers on cpu before you hit run on your code?
> I put it in my cstartup_sam7.c code and it won't start up,
> gives a processor wrong mode error message.
> You help is greatly appreciated, "PROST"!! > Andrew
>
> --- In AT91SAM7@AT91..., "Uli Hansen" <uh@a...> wrote:
> > Hallo,
> >
> > my Evaluation Kit is working now.
> > I had to do some initialization commands before debugging.
> >
> > This are:
> >
> > // execute peripheral reset as first command 1.
> > AT91C_RSTC_RCR=0xA5000004
> >
> > 2. AT91C_CKGR_MOR=0x00000601
> >
> > // 3 Setting PLL and divider:
> > // - div by 5 Fin = 3,6864 =(18,432 / 5)
> > // - Mul 25+1: Fout = 95,8464 =(3,6864 *26)
> > // for 96 MHz the erroe is 0.16%
> > // Field out NOT USED = 0
> > // PLLCOUNT pll startup time esrtimate at : 0.844 ms //
> PLLCOUNT 28 =
> > 0.000844 /(1/32768) // pPMC->PMC_PLLR = ((AT91C_CKGR_DIV & 0x05) |
> (AT91C_CKGR_PLLCOUNT &
> > (28<<8)) | (AT91C_CKGR_MUL & (25<<16)));
> >
> > 3. AT91C_CKGR_PLLR= 0x00191C05
> >
> > // 4. Selection of Master Clock and Processor Clock //
> select the PLL
> > clock divided by 2 // pPMC->PMC_MCKR = AT91C_PMC_CSS_PLL_CLK |
> > AT91C_PMC_PRES_CLK_2 ; 4. AT91C_PMCR_MCKR= 0x00000007
> >
> > Good luck
> > Uli >
> Yahoo! Groups Links