U32 WriteSector(U32 index,U8 *buff) { volatile U16 *Dest; volatile U16 *Org; U16 i,k; Org = (volatile U16 *)buff; Dest = (volatile U16 *)(GetSecAddr(index));
/*section1*/ *(volatile U16 *)(0x0000AAAA)=0xAAAA; *(volatile U16 *)(0x00005554)=0x5555; *(volatile U16 *)(0x0000AAAA)=0x8080; *(volatile U16 *)(0x0000AAAA)=0xAAAA; *(volatile U16 *)(0x00005554)=0x5555; *Dest =0x3030; for(k=0;k<65000;k++); for(k=0;k<65000;k++); printf("."); if (!buff) return 0; for (i=0;i<SECLEN;i++) {
/*section2*/ *(volatile U16 *)(0x0000AAAA)=0xAAAA; *(volatile U16 *)(0x00005554)=0x5555; *(volatile U16 *)(0x0000AAAA)=0xA0A0; *(Dest+i)=*(Org+i); for(k=0;k<200;k++); if(*(Dest)!=*(Org)) return 0; } return SECLEN; }
大虾,帮我看看为什么我执行到section1就死了,是不是还要做什么设置啊