More details:
First:
This is the code we wrote to program the flash:
void main()
{
volatile unsigned int * start_flash = (volatile unsigned int *)0x00001000;
volatile unsigned int * end_flash = (volatile unsigned int *)0x0001ffff;
volatile unsigned char * flash_addr1 = (volatile unsigned char *)0x005555;
volatile unsigned char * flash_addr2 = (volatile unsigned char *)0x002aaa;
volatile unsigned char * flash_addr3 = (volatile unsigned char *)0x005555;
volatile unsigned char * flash_addr4 = (volatile unsigned char *)0x010000;
volatile unsigned int x = 0;
// Chip Erase
* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr1 = 0x80;
* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr1 = 0x10;
// Delay
for(x=0;x<=100000;x++);
// Byte Program
* flash_addr1 = 0xaa;
* flash_addr2 = 0x55;
* flash_addr3 = 0xa0;
// Data in the first address
* (start_flash) = 0xba;
for(x=0;x<=100000;x++);
// Data in the following address
* (start_flash+1) = 0xab;
while(1);
}
"BA" is written correctly in the first address but "AB" isn't.
Second:
We are using an FPGA in the system between the DSP and the Flash (and all other system peripherals). Data and Address of DSP is bypassed to the Flash, and control signals are generated from the FPGA. I think there is no problem in generating the control signals since we are able to write one byte successfully, is that correct?