Yahoo Groups archive

Lpc2000

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

Message

Re: Fixed address ARRAY

2005-11-29 by Karl Olsen

--- In lpc2000@yahoogroups.com, "gomolava1" <gomolava1@y...> wrote:
> 
> Is it exist simple method to place an ARRAY to a fixed memory
> location  in gcc,like in Keil:
> const unsigned char eeprom[EE_SIZE]_at_EE_ADDR_L;
>  
> For a variable
> unsigned int dd _at_ 0x81000000;
>  
> previous answers suggested:
> int * dd = ((unsigned int *)0x81000000);
> 
> Have I to use separate section in linker script?

You don't have to.  You can also use a pointer to access an array:

unsigned char *eeprom = (unsigned char *)0x81000000;
...
i = eeprom[34];

and to access a struct:

struct eedata
{
  int ee1;
  int ee2;
};

struct eedata *pe = (struct eedata *)0x81000000;
...
i = pe->ee1;


Karl Olsen

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.