I wanted to write a image to flash with IAP. the function like this:
typeof IAPCALL (void)iaplocal(int *,int *);
IAPCALL iapcall=0x7ffffff1;
int cmd[5],ret[3]; cmd[0]=51;//cmd id cmd[1]=0x1000;//flash start addr cmd[2]=0x40002000;//ram start addr cmd[3]=256;//size cmd[4]=10000;//system clock
iapcall(cmd,ret);
i check ret,the ret[0] is 0,that means copy ram to flash success.(I use cmd 50 to prepare flash select before i call this fucntion and i also check the section of flash is blank). but i compare the data in flash ,the flash is still blank.the data is not writen into flash.
I prefer your help! thanks!
I disable intrrupt CPSR of arm and VICIntEnable VICIntEnClr of LPC2132, It seems no effective. I still cann't copy ram to flash with iap. I call like following:
IAPCALL(50,1,8).//select sector 1 to 8,return is ok IAPCALL(52,1,8).//erase sector 1 to 8,return is ok IAPCALL(53,1,8).//check blank of sector 1 to 8,return is ok IAPCALL(50,1,8).//select sector 1 to 8,return is ok IAPCALL(51,0x1000,0x40002000,256,10000);//copy data start from 0x40002000 in ram to flash 0x1000,the size is 256 and system clk is 10000 khz. return is ok IAPCALL(56,0x1000,0x40002000,256);//but return compare_error