I try to write an array to address 0xe0 00 00 ( word address 0x38 00 00). So data should be 2 followed by 3 then 4, then 5
But when i read back i get 0, 2, 3 ,4
I am using auto increment read and write operations.
Is this a FIFO flush problem?
CODE :
printf("code load\n"); writelocn(addressHpi,0x380000); for(i = 0;i<4;i++) { check = (*controlHpi)&(0x00000008); //printf("check %x",check); while(check!=0x00000008){ check = (*controlHpi)&(0x00000008); //dbgprintf("1\t"); } *dataHpi = arr[i]; } writelocn(controlHpi,0x800); writelocn(addressHpi,0x380000); for(i = 0;i<4;i++) { check = (*controlHpi)&(0x00000008); //printf("check %x",check); while(check!=0x00000008){ check = (*controlHpi)&(0x00000008); //dbgprintf("1\t"); } printf("%x\n",*dataHpi); }
OUTPUT
address = 380000
address = 380001
address = 380002
address = 380003
0
2
3
4
Thank you
Anish