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;