Yahoo Groups archive

Lpc2000

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

Message

Re: Timer issues

2005-07-26 by soren_t_hansen

--- In lpc2000@yahoogroups.com, 42Bastian Schick <bastian42@m...> wrote:
> soren_t_hansen <soren_t_hansen@y...> schrieb am Tue, 26 Jul 2005 
> 08:16:23 -0000:
> 
> > I'm having some problems with the timer on a lpc2132 in the following
> > way: I'm developing a program which I'm running from RAM while
> > debugging. I've set up MEMMAP=2 to remap the interrupt vectors and it
> > does work .... sometimes. Here goes ..
> >
> > I use Eclipse with the Zylin embedded plugin. When I want to debug I
> > download the program and starts execution. But the first time I end up
> > in the DApt_Handler no matter what. Then I download the program once
> > more (without powercycling the board) and this time it all runs
> > without problems (I'm watching a global counter). If I then try to
> > download once more, it sometimes work and sometimes don't.
> > I have the ADC running at the same time and it suffers the same
> > problems, but if I run without the timer and just the ADC it works
> > like a charm. If I run the Timer without the ADC I still get the
problem.
> 
> You should reset the VIC (disable all interrupts) before downloading
> (gdb init script).
> Be also sure you have MEMMAP set correctly before downloading.
> I link my vectors at 0 so I set MEMMAP to 2 before. If you link
> your vectors to 0x40000000 be sure to set MEMMAP to 0, and your code
> sets it to 2.
> 

I'm rather new at this embedded programming, and especially with the
ARM7, so if you could clarify how to do the things you just mentioned,
I would be very thankfull.
As it is now I link my vectors to 0x40000000 :

MEMORY
{
  CODE (rx) : ORIGIN = 0x40000000, LENGTH = 0x00003000
  DATA (rw) : ORIGIN = 0x40003000, LENGTH = 0x00001000
}

/* Section Definitions */
SECTIONS
{
  /* first section is .text which is used for code */
  .text :
 {
    *crt0.arm.o (.text)            /* Startup code */
    *(.text)                   /* remaining code */
    *(.glue_7t) *(.glue_7)
  } >CODE =0
 ....etc etc

I set my MEMMAP to 2 in the startup code with: 
MEMMAP_USER_RAM_MODE    = (1<<1)

void _c_startup(void)
{
	initSegments();
	initPLL();
	initMAM();
	MEMMAP = MEMMAP_USER_RAM_MODE;
	runCppCtors();
}

/Søren

Attachments

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.