Hi I would like to write data to internal flash. I use function:
_attribute_ ((section (".ramfunc"))) int AT91F_Flash_Write( unsigned
int Flash_Address ,int size ,unsigned int * buff)
{
AT91PS_MC ptMC = AT91C_BASE_MC;
unsigned int i, page, status;
unsigned int * Flash;
status = 0;
Flash = (unsigned int *) Flash_Address;
page = ((Flash_Address - (unsigned int)AT91C_IFLASH )
/FLASH_PAGE_SIZE);
for (i=0; (i < FLASH_PAGE_SIZE) & (size > 0) ;i++,
Flash++,buff++,size-=4 ){
*Flash=*buff;
}
unsigned long ulIntrStat = AT91C_BASE_AIC->AIC_IMR;
AT91C_BASE_AIC->AIC_IDCR = 0xFFFFFFFF;
ptMC->MC_FCR =AT91C_MC_CORRECT_KEY | AT91C_MC_FCMD_START_PROG |
(AT91C_MC_PAGEN & (page<<8));
for(i=0;i<100000;i++) asm("nop");
while ((status & AT91C_MC_FRDY) != AT91C_MC_FRDY )
{
status = AT91C_BASE_MC->MC_FSR;
}
AT91C_BASE_AIC->AIC_IECR = ulIntrStat;
if ( (status & ( AT91C_MC_PROGE | AT91C_MC_LOCKE ))!=0)
return false;
return true;
}
The problem is that the error occurs during making project:
arm-elf-ld: error: no memory region specified for loadable section
`.ramfunc'
make: *** [main.out] Error 1
I use Eclipse with Yagarto.
Please for help. Thanks in Advance.