Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to store data variable in embeded flash on AT91SAM7X
PostPosted: Tue Apr 28, 2009 9:19 pm 
Offline

Joined: Wed Aug 16, 2006 8:24 pm
Posts: 8
Location: MA, US
I stored IP address as a variable on my AT91SAM7X. I change it sometimes. After changing it, next time when my board is powered up, the new IP should be used. How can I store a variable after power is off? Can I write it to the embeded flash, and is there any sample code showing how to do it?

Any help is greatly appreciated,

Kelly


Top
 Profile  
 
 Post subject: Re: How to store data variable in embeded flash on AT91SAM7X
PostPosted: Mon Aug 24, 2009 8:28 pm 
Offline

Joined: Fri Jul 10, 2009 8:16 pm
Posts: 15
I didn't try it, but as far as I know & read - you should use a pointer to point at the memory space of the FLASH.

The RAM, FLASH & ROM share the same memory space.

For example, in the file "AT91SAM7X256.h" you can find the following lines at the bottom:

Code:
// *****************************************************************************
//               MEMORY MAPPING DEFINITIONS FOR AT91SAM7X256
// *****************************************************************************
// ISRAM
#define AT91C_ISRAM    (0x00200000) // Internal SRAM base address
#define AT91C_ISRAM_SIZE    (0x00010000) // Internal SRAM size in byte (64 Kbytes)
// IFLASH
#define AT91C_IFLASH    (0x00100000) // Internal FLASH base address
#define AT91C_IFLASH_SIZE    (0x00040000) // Internal FLASH size in byte (256 Kbytes)
#define AT91C_IFLASH_PAGE_SIZE    (256) // Internal FLASH Page Size: 256 bytes
#define AT91C_IFLASH_LOCK_REGION_SIZE    (16384) // Internal FLASH Lock Region Size: 16 Kbytes
#define AT91C_IFLASH_NB_OF_PAGES    (1024) // Internal FLASH Number of Pages: 1024 bytes
#define AT91C_IFLASH_NB_OF_LOCK_BITS    (16) // Internal FLASH Number of Lock Bits: 16 bytes


focus on the following:
Code:
#define AT91C_IFLASH    (0x00100000) // Internal FLASH base address


and write something like this:

Code:
char *data;
data = AT91C_IFLASH;
*data = 0x10;


Top
 Profile  
 
 Post subject: Re: How to store data variable in embeded flash on AT91SAM7X
PostPosted: Mon Oct 19, 2009 9:40 am 
Offline

Joined: Tue Jun 20, 2006 3:19 pm
Posts: 9
Read
20. Embedded Flash Controller (EFC)
20.2.3 Write Operations


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: