Aaron Lager

freescale_flash_loader.c, troubles getting it to work on 52235evb

Discussion created by Aaron Lager on Jun 17, 2008
Latest reply on Jun 19, 2008 by Aaron Lager
This is the code I've tried:
Code:
void update_my_flash_vars(char *unitid){ unsigned long address = 0x4403f7ff; //0x4403f800; char * foo ="test characters"; flash_init(); flash_page_erase((unsigned long *)address,(unsigned long)0); //0x4403f800 is the last flash page         //0x800 bytes (2k)long. fill it with zeros         //flash_write((unsigned long *)address, (unsigned long*)unitid); flash_write((unsigned long *)address, (unsigned long*)foo);}

But all I get is this error on the console:
Access Error -- PC = 0x0000F982
Error on operand write
Access Error -- PC = 0x0000F9CE
Error on operand write

From the xMap file:
#>00038040          ___DATA_ROM (linker command file)
I should have plenty of space to do this.  And I don't think that the addresses are interfering.

The process is supposed to be:
1. init the flash
2. erase a page()
3. write to a page()
What am I doing wrong?

I'm using the Internich code rev 2.0. 

Thanks,
Aaron

Outcomes