Yahoo Groups archive

Lpc2000

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

Thread

__ram attribute in Keil CA compiler

__ram attribute in Keil CA compiler

2004-12-09 by varuzhandanielyan

I have written very simple code just to evaluate the LPC2129
speed for the Keil MCB2100 board:

void Meander(void)
{
  unsigned int n;

  n = 0x00010000;	
  while (1) {
    IOSET1 = n;
    IOCLR1 = n;
  }
}

It works well and I can scope the meander pulses.  But when I add
the __ram attribute:

void Meander(void) __ram

The program does not work.  Should I make any other changes in the
program or compiler settings to force the code work from RAM?

Thanks,
Varuzhan

Re: __ram attribute in Keil CA compiler

2004-12-10 by beano040461

--- In lpc2000@yahoogroups.com, "varuzhandanielyan" <dan@x> wrote:
> 
> I have written very simple code just to evaluate the LPC2129
> speed for the Keil MCB2100 board:
> 
> void Meander(void)
> {
>   unsigned int n;
> 
>   n = 0x00010000;	
>   while (1) {
>     IOSET1 = n;
>     IOCLR1 = n;
>   }
> }
> 
> It works well and I can scope the meander pulses.  But when I add
> the __ram attribute:
> 
> void Meander(void) __ram
> 
> The program does not work.  Should I make any other changes in the
> program or compiler settings to force the code work from RAM?
> 
> Thanks,
> Varuzhan

You need at the location of ram you wish to use to run the code 
In the la locate user classes section of the target options use the 
ERAM directive
i.e
ERAM(0x0400-0x4FF)
making sure that you allocate enough space for the function
paul

Re: __ram attribute in Keil CA compiler

2004-12-10 by varuzhandanielyan

Ok,

I write ERAM(0x40003F00-0x40003FFF) in the mentioned place
and it works.  But two more questions
1. Isn't it possible to force the system to automatically allocate
necessary space for ERAM segment?
2. Very strange, but the code (see below) runs from the RAM with the
same speed as from Flash.  What mistake I do?

Thank you in advanca,
Varuzhan


--- In lpc2000@yahoogroups.com, "beano040461" <paulbearne@b...> wrote:
Show quoted textHide quoted text
> 
> --- In lpc2000@yahoogroups.com, "varuzhandanielyan" <dan@x> wrote:
> > 
> > I have written very simple code just to evaluate the LPC2129
> > speed for the Keil MCB2100 board:
> > 
> > void Meander(void)
> > {
> >   unsigned int n;
> > 
> >   n = 0x00010000;	
> >   while (1) {
> >     IOSET1 = n;
> >     IOCLR1 = n;
> >   }
> > }
> > 
> > It works well and I can scope the meander pulses.  But when I add
> > the __ram attribute:
> > 
> > void Meander(void) __ram
> > 
> > The program does not work.  Should I make any other changes in the
> > program or compiler settings to force the code work from RAM?
> > 
> > Thanks,
> > Varuzhan
> 
> You need at the location of ram you wish to use to run the code 
> In the la locate user classes section of the target options use the 
> ERAM directive
> i.e
> ERAM(0x0400-0x4FF)
> making sure that you allocate enough space for the function
> paul

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.