Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Timer interrupt when executing from RAM

Timer interrupt when executing from RAM

2005-06-30 by soren_t_hansen

Hi

I'm having a hard time making the interrupt work, when debugging my
code. When I debug, I run the program from RAM and use the arm-elf-gdb
to debug through a JTAG interface.

I've have set my MEMMAP = 2 and the code I'm testing works alright
when run from Flash.

Is there anything else I'm missing out regarding to interrupts when
running from RAM?

Best Regards
Søren

RE: [lpc2000] Timer interrupt when executing from RAM

2005-06-30 by Dan Beadle

You probably want to set MEMMAP=2 BEFORE you download the code to make sure that the vectors are set.  

 

Try setting a breakpoint in the VIC handler.  

 

Obviously, if you have the code working from Flash, the VIC programming is correct.  My guess would be that either you are not loading up the vectors correctly at program load or you are corrupting your program when loaded in RAM.

 

  _____  
Show quoted textHide quoted text
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of soren_t_hansen
Sent: Thursday, June 30, 2005 3:50 AM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Timer interrupt when executing from RAM

 

Hi

I'm having a hard time making the interrupt work, when debugging my
code. When I debug, I run the program from RAM and use the arm-elf-gdb
to debug through a JTAG interface.

I've have set my MEMMAP = 2 and the code I'm testing works alright
when run from Flash.

Is there anything else I'm missing out regarding to interrupts when
running from RAM?

Best Regards
Søren





  _____  

YAHOO! GROUPS LINKS 

 

*	 Visit your group "lpc2000 <http://groups.yahoo.com/group/lpc2000> " on the web.
	  
*	 To unsubscribe from this group, send an email to:
	 lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
	  
*	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 

 

  _____  



[Non-text portions of this message have been removed]

RE: [lpc2000] Timer interrupt when executing from RAM

2005-06-30 by Keith Wentworth

Using the LPC2131 AND LPC2138:
I have been experiencing a problem when running in RAM or ROM with the jlink debugger. Sometimes no interrupts will work at all. All I have to do is unplug the debugger and power from my board. PLug them back in and start over.
 
I am not sure what is the root cause. IAR is looking in to it.

Dan Beadle <dan.beadle@...> wrote:
You probably want to set MEMMAP=2 BEFORE you download the code to make sure that the vectors are set.  



Try setting a breakpoint in the VIC handler.  



Obviously, if you have the code working from Flash, the VIC programming is correct.  My guess would be that either you are not loading up the vectors correctly at program load or you are corrupting your program when loaded in RAM.



  _____  
Show quoted textHide quoted text
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of soren_t_hansen
Sent: Thursday, June 30, 2005 3:50 AM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Timer interrupt when executing from RAM



Hi

I'm having a hard time making the interrupt work, when debugging my
code. When I debug, I run the program from RAM and use the arm-elf-gdb
to debug through a JTAG interface.

I've have set my MEMMAP = 2 and the code I'm testing works alright
when run from Flash.

Is there anything else I'm missing out regarding to interrupts when
running from RAM?

Best Regards
Søren





  _____  

YAHOO! GROUPS LINKS 



*      Visit your group "lpc2000 <http://groups.yahoo.com/group/lpc2000> " on the web.
        
*      To unsubscribe from this group, send an email to:
      lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
        
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 



  _____  



[Non-text portions of this message have been removed]



SPONSORED LINKS 
Microcontrollers Microprocessor Intel microprocessors Pic microcontrollers 

---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "lpc2000" on the web.
  
    To unsubscribe from this group, send an email to:
 lpc2000-unsubscribe@yahoogroups.com
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]

Re: Timer interrupt when executing from RAM

2005-06-30 by Gus

I had a problem using timer interrupts in the past. I had the 
interrupt flag set of the timer but ARM core didn't see it! I tried 
resetting and everyting else but didn't work.......after 2 hours, I 
repowered the board and everything worked just fine!!! For some 
reason, reset != power cycleing

Gus

--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> You probably want to set MEMMAP=2 BEFORE you download the code to 
make sure that the vectors are set.  
> 
>  
> 
> Try setting a breakpoint in the VIC handler.  
> 
>  
> 
> Obviously, if you have the code working from Flash, the VIC 
programming is correct.  My guess would be that either you are not 
loading up the vectors correctly at program load or you are 
corrupting your program when loaded in RAM.
> 
>  
> 
>   _____  
> 
> From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On 
Behalf Of soren_t_hansen
> Sent: Thursday, June 30, 2005 3:50 AM
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] Timer interrupt when executing from RAM
> 
>  
> 
> Hi
> 
> I'm having a hard time making the interrupt work, when debugging my
> code. When I debug, I run the program from RAM and use the arm-elf-
gdb
> to debug through a JTAG interface.
> 
> I've have set my MEMMAP = 2 and the code I'm testing works alright
> when run from Flash.
> 
> Is there anything else I'm missing out regarding to interrupts when
> running from RAM?
> 
> Best Regards
> Søren
> 
> 
> 
> 
> 
>   _____  
> 
> YAHOO! GROUPS LINKS 
> 
>  
> 
> *	 Visit your group "lpc2000 
<http://groups.yahoo.com/group/lpc2000> " on the web.
> 	  
> *	 To unsubscribe from this group, send an email to:
> 	 lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-
unsubscribe@yahoogroups.com?subject=Unsubscribe> 
> 	  
> *	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service <http://docs.yahoo.com/info/terms/> . 
Show quoted textHide quoted text
> 
>  
> 
>   _____  
> 
> 
> 
> [Non-text portions of this message have been removed]

RE: [lpc2000] Timer interrupt when executing from RAM

2005-06-30 by Dan Beadle

I have been using IAR and JLink for about 9 months now.  I have not seen this type of problem.  

 

IAR / JLink normally does not do a hardware reset of the chip - they do a simulated reset.  That means putting you into supervisor mode and setting the PC to 0. They DO NOT reset all the peripherals in this mode.  The VIC does not get reset, as far as I can tell. 

 

I think it is a good idea to check the "Hardware Reset" box on the JLink tab.  But some systems (like the Sharp LH7A404 that I am working on now) require some startup code to run.  You add a delay after reset.  LPCs do this to run the IAP loader, which then branches to our code....  During this time after reset, stuff happens.  Registers can be changed from the book reset value. 

 

So, the best code assumes nothing at startup.  

 

You might set a breakpoint early in your code and see if the VIC is really at he reset state. If not, set it all up, then clear any pending interrupts

 

Please advise your results

 

Dan

 

  _____  
Show quoted textHide quoted text
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of Keith Wentworth
Sent: Thursday, June 30, 2005 9:26 AM
To: lpc2000@yahoogroups.com
Subject: RE: [lpc2000] Timer interrupt when executing from RAM

 

Using the LPC2131 AND LPC2138:
I have been experiencing a problem when running in RAM or ROM with the jlink debugger. Sometimes no interrupts will work at all. All I have to do is unplug the debugger and power from my board. PLug them back in and start over.

I am not sure what is the root cause. IAR is looking in to it.

Dan Beadle <dan.beadle@...> wrote:
You probably want to set MEMMAP=2 BEFORE you download the code to make sure that the vectors are set.  



Try setting a breakpoint in the VIC handler.  



Obviously, if you have the code working from Flash, the VIC programming is correct.  My guess would be that either you are not loading up the vectors correctly at program load or you are corrupting your program when loaded in RAM.



  _____  

From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of soren_t_hansen
Sent: Thursday, June 30, 2005 3:50 AM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Timer interrupt when executing from RAM



Hi

I'm having a hard time making the interrupt work, when debugging my
code. When I debug, I run the program from RAM and use the arm-elf-gdb
to debug through a JTAG interface.

I've have set my MEMMAP = 2 and the code I'm testing works alright
when run from Flash.

Is there anything else I'm missing out regarding to interrupts when
running from RAM?

Best Regards
Søren





  _____  

YAHOO! GROUPS LINKS 



*      Visit your group "lpc2000 <http://groups.yahoo.com/group/lpc2000> " on the web.
        
*      To unsubscribe from this group, send an email to:
      lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
        
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 



  _____  



[Non-text portions of this message have been removed]



SPONSORED LINKS 
Microcontrollers Microprocessor Intel microprocessors Pic microcontrollers 

---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "lpc2000" on the web.
  
    To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]




  _____  

YAHOO! GROUPS LINKS 

 

*	 Visit your group "lpc2000 <http://groups.yahoo.com/group/lpc2000> " on the web.
	  
*	 To unsubscribe from this group, send an email to:
	 lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
	  
*	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 

 

  _____  



[Non-text portions of this message have been removed]

Re: Timer interrupt when executing from RAM

2005-06-30 by keithgw_strider

The problem seems to be from hitting a breakpoint in an interrupt 
routine then exiting the debugger, (edit code), re run the debugger. 
I am guessing that the VIC still thinks it is in an interrupt and 
won't allow any more. Power cycling fixes the problem. 

I have looked at the VIC registers when this problem has been 
occuring, they are all set correctly. I can see that the Timer is 
counting, interrupts are enabled, but I don't get any interrupts.
It is not a big deal for me since I have a workaround. I just wanted 
to share my experience in case soneone else had a similar problem.


--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> I have been using IAR and JLink for about 9 months now.  I have 
not seen this type of problem.  
> 
>  
> 
> IAR / JLink normally does not do a hardware reset of the chip - 
they do a simulated reset.  That means putting you into supervisor 
mode and setting the PC to 0. They DO NOT reset all the peripherals 
in this mode.  The VIC does not get reset, as far as I can tell. 
> 
>  
> 
> I think it is a good idea to check the "Hardware Reset" box on the 
JLink tab.  But some systems (like the Sharp LH7A404 that I am 
working on now) require some startup code to run.  You add a delay 
after reset.  LPCs do this to run the IAP loader, which then 
branches to our code....  During this time after reset, stuff 
happens.  Registers can be changed from the book reset value. 
> 
>  
> 
> So, the best code assumes nothing at startup.  
> 
>  
> 
> You might set a breakpoint early in your code and see if the VIC 
is really at he reset state. If not, set it all up, then clear any 
pending interrupts
> 
>  
> 
> Please advise your results
> 
>  
> 
> Dan
> 
>  
> 
>   _____  
> 
> From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On 
Behalf Of Keith Wentworth
> Sent: Thursday, June 30, 2005 9:26 AM
> To: lpc2000@yahoogroups.com
> Subject: RE: [lpc2000] Timer interrupt when executing from RAM
> 
>  
> 
> Using the LPC2131 AND LPC2138:
> I have been experiencing a problem when running in RAM or ROM with 
the jlink debugger. Sometimes no interrupts will work at all. All I 
have to do is unplug the debugger and power from my board. PLug them 
back in and start over.
> 
> I am not sure what is the root cause. IAR is looking in to it.
> 
> Dan Beadle <dan.beadle@i...> wrote:
> You probably want to set MEMMAP=2 BEFORE you download the code to 
make sure that the vectors are set.  
> 
> 
> 
> Try setting a breakpoint in the VIC handler.  
> 
> 
> 
> Obviously, if you have the code working from Flash, the VIC 
programming is correct.  My guess would be that either you are not 
loading up the vectors correctly at program load or you are 
corrupting your program when loaded in RAM.
> 
> 
> 
>   _____  
> 
> From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On 
Behalf Of soren_t_hansen
> Sent: Thursday, June 30, 2005 3:50 AM
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] Timer interrupt when executing from RAM
> 
> 
> 
> Hi
> 
> I'm having a hard time making the interrupt work, when debugging my
> code. When I debug, I run the program from RAM and use the arm-elf-
gdb
> to debug through a JTAG interface.
> 
> I've have set my MEMMAP = 2 and the code I'm testing works alright
> when run from Flash.
> 
> Is there anything else I'm missing out regarding to interrupts when
> running from RAM?
> 
> Best Regards
> Søren
> 
> 
> 
> 
> 
>   _____  
> 
> YAHOO! GROUPS LINKS 
> 
> 
> 
> *      Visit your group "lpc2000 
<http://groups.yahoo.com/group/lpc2000> " on the web.
>         
> *      To unsubscribe from this group, send an email to:
>       lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-
unsubscribe@yahoogroups.com?subject=Unsubscribe> 
>         
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service <http://docs.yahoo.com/info/terms/> . 
> 
> 
> 
>   _____  
> 
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> SPONSORED LINKS 
> Microcontrollers Microprocessor Intel microprocessors Pic 
microcontrollers 
> 
> ---------------------------------
> YAHOO! GROUPS LINKS 
> 
> 
>     Visit your group "lpc2000" on the web.
>   
>     To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
>   
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> ---------------------------------
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> 
>   _____  
> 
> YAHOO! GROUPS LINKS 
> 
>  
> 
> *	 Visit your group "lpc2000 
<http://groups.yahoo.com/group/lpc2000> " on the web.
> 	  
> *	 To unsubscribe from this group, send an email to:
> 	 lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-
unsubscribe@yahoogroups.com?subject=Unsubscribe> 
> 	  
> *	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service <http://docs.yahoo.com/info/terms/> . 
Show quoted textHide quoted text
> 
>  
> 
>   _____  
> 
> 
> 
> [Non-text portions of this message have been removed]

Re: Timer interrupt when executing from RAM

2005-06-30 by soren_t_hansen

--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> You probably want to set MEMMAP=2 BEFORE you download the code to
make sure that the vectors are set.  

I have the MEMMAP = 2 as the first line in my main.

> Try setting a breakpoint in the VIC handler.  

Done that, but the handler newer gets called.
 
> 
> Obviously, if you have the code working from Flash, the VIC
programming is correct.  My guess would be that either you are not
loading up the vectors correctly at program load or you are corrupting
your program when loaded in RAM.

After having looked at the elf file with objdump it seems as if the
VIC interrupt handler points to the an address 3fffffef (or similar
isn't at work just now) - but that's in the flash! So maybe it is my
startup code that's wrong?

I have ldr pc, [pc, #-0x0FF0] (again - it's taken from my memory) as
my VIC handler and it works in flash. Is it the same in RAM?

Best Regards
Søren

RE: [lpc2000] Re: Timer interrupt when executing from RAM

2005-06-30 by Dan Beadle

The vic address is up in high memory FFFF.... The trick of #-0xff0 lets the PC wrap to that address.  So 3fff ffef sure sounds like the wrong location to me.  Is it the same when you are running from Flash?

 

 

I have seen and reported a problem to IAR with single stepping through indirect addresses.  They have not replied in about a month.  I just don't step through the vectors.

 

  _____  
Show quoted textHide quoted text
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of soren_t_hansen
Sent: Thursday, June 30, 2005 1:45 PM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Re: Timer interrupt when executing from RAM

 

--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> You probably want to set MEMMAP=2 BEFORE you download the code to
make sure that the vectors are set.  

I have the MEMMAP = 2 as the first line in my main.

> Try setting a breakpoint in the VIC handler.  

Done that, but the handler newer gets called.

> 
> Obviously, if you have the code working from Flash, the VIC
programming is correct.  My guess would be that either you are not
loading up the vectors correctly at program load or you are corrupting
your program when loaded in RAM.

After having looked at the elf file with objdump it seems as if the
VIC interrupt handler points to the an address 3fffffef (or similar
isn't at work just now) - but that's in the flash! So maybe it is my
startup code that's wrong?

I have ldr pc, [pc, #-0x0FF0] (again - it's taken from my memory) as
my VIC handler and it works in flash. Is it the same in RAM?

Best Regards
Søren





  _____  

YAHOO! GROUPS LINKS 

 

*	 Visit your group "lpc2000 <http://groups.yahoo.com/group/lpc2000> " on the web.
	  
*	 To unsubscribe from this group, send an email to:
	 lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> 
	  
*	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 

 

  _____  



[Non-text portions of this message have been removed]

Re: [lpc2000] Timer interrupt when executing from RAM

2005-06-30 by Gerhard Kammerer

You must not read the VIC registers in the register window.
This kills the breakpoints :-(

Gerhard


Keith Wentworth wrote:
Show quoted textHide quoted text
> Using the LPC2131 AND LPC2138:
> I have been experiencing a problem when running in RAM or ROM with the jlink debugger. Sometimes no interrupts will work at all. All I have to do is unplug the debugger and power from my board. PLug them back in and start over.
>  
> I am not sure what is the root cause. IAR is looking in to it.
>

Re: [lpc2000] Timer interrupt when executing from RAM

2005-06-30 by Gerhard Kammerer

Gerhard Kammerer wrote:
> You must not read the VIC registers in the register window.
> This kills the breakpoints :-(

Sorry, i mean this kills the Interrupts

Gerhard
Show quoted textHide quoted text
> 
> Keith Wentworth wrote:
> 
>>Using the LPC2131 AND LPC2138:
>>I have been experiencing a problem when running in RAM or ROM with the jlink debugger. Sometimes no interrupts will work at all. All I have to do is unplug the debugger and power from my board. PLug them back in and start over.
>> 
>>I am not sure what is the root cause. IAR is looking in to it.
>>
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
>

Re: Timer interrupt when executing from RAM

2005-07-01 by soren_t_hansen

--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> The vic address is up in high memory FFFF.... The trick of #-0xff0
lets the PC wrap to that address.  So 3fff ffef sure sounds like the
wrong location to me.  Is it the same when you are running from Flash?

When running from flash the PC gets loaded with the correct address :
fffff030
But when running from Ram, the objdump tells me that the pc is loaded
with the address 3ffff030

I'll have to try to load the address of the Vic address to the pc
manually and see if that helps.

/Søren

Re: Timer interrupt when executing from RAM

2005-07-01 by soren_t_hansen

--- In lpc2000@yahoogroups.com, "soren_t_hansen" <soren_t_hansen@y...>
wrote:
> --- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> > The vic address is up in high memory FFFF.... The trick of #-0xff0
> lets the PC wrap to that address.  So 3fff ffef sure sounds like the
> wrong location to me.  Is it the same when you are running from Flash?
> 
> When running from flash the PC gets loaded with the correct address :
> fffff030
> But when running from Ram, the objdump tells me that the pc is loaded
> with the address 3ffff030
> 
> I'll have to try to load the address of the Vic address to the pc
> manually and see if that helps.
> 
> /Søren

This is really starting to annoy me big time. Running with my original
set of startup + linker files I'm now able to make the interrupts work
the first time after I've powered up the board. If I then make another
download through the Jtag the interrupts stops working.

I must admit that at this moment I've no clue of what's going on...

Does someone have a working setup that allows them to debug from Ram
and use interrupts at the same time, whitout having to power cycle the
board every time? If this is the case, I would very much like to see
their startup and linker files.

Best Regards
Søren

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.