9 years ago.

IAP not to work in Keil Simulation.

Hello all. I have written a code for IAP with LPC1768 in keil. I want to write some data from SRAM to Flash by IAP. But i don't know why it doesn't work in simulation of Keil Software. Actually it is only written in SRAM but nothing in flash. My code is the same as below: If somebody could test my code in Keil I'll appreciate it so much. thanks.

  1. include <lpc17xx.h>
  2. include <absacc.h>

unsigned char IAP_Write(unsigned char *string); unsigned char a[5] at(0x10000200);

  1. define IAP_ADDRESS 0x1FFF1FF1 unsigned int command[5]; unsigned int result[5]; typedef unsigned int (*IAP)(unsigned int[], unsigned int[]); static const IAP iap_entry = (IAP) IAP_ADDRESS;

int main(void) { unsigned char i=0; for(i=0;i<5;i++) a[i]=i; IAP_Write(a); } unsigned char IAP_Write(unsigned char *string) { command[0]=50; command[1]=8; Start sector number is 8 command[2]=8; Finish sector number is 8 iap_entry(command,result); if(result[0]!=0) { return 0; } command[0]=51; command[1]=0x00008100; Addrees of Flash command[2]=0x10000200; Addrees of Sram command[3]=256; How many bytes want to transfer command[4]=12000; Frequency in khz iap_entry(command,result); }

Be the first to answer this question.