lpcware

IAP problem LPC2138

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by salamlora1 on Mon Nov 04 23:41:36 MST 2013
Hi i have some problem in writing operation can anyone help me to understand what’s wrong in my codes??? (Sorry about my poor English)




#include "config.h"
#include "gpio.h"
//#include "iap_driver.h"
void delay_ms(us32 t)
{
  t=t*2000;
  while(t--);
}

enum state
{
  on,
  off
}x;

void main (void)
{
int javab =0  ;
  int *a[1000];
   
p1_out_init_bit(19);
p0_in_init_bit(6);
//p0_clr_bit(19);

while(1)
{


  if (p0_read_bit(6)==1)
  {

    if (x==on)
    {
      p1_set_bit(19);
      x=off;
    }
    else
    {
      p1_clr_bit(19);
      x=on;
    }
    p0_out_init_bit(19);
    while (1){
      #define IAP_LOCATION 0x7ffffff1;    
      char a[256];
      int b=0;
      for (b=0;b<256;b++)
        a=b;
     unsigned int command[5];
     unsigned int result[2];
     typedef void (*IAP)(unsigned int [],unsigned int[]);
     IAP iap_entry;
     iap_entry=(IAP) IAP_LOCATION;
     command[0]=50;
     command[1]=6;
     command[2]=6;
     iap_entry (command, result);
     //iap_entry=(IAP) IAP_LOCATION;
     command[0]=51;
     command[1]=(unsigned long)0x00058000;
     command[2]=(unsigned short)&a;
     command[3]=256;
     command[4]=12000;
    iap_entry (command, result);
   
     command[0]=53;
     command[1]=5;
     command[2]=5;//0x00027fff;
     command[3]=0;
     command[4]=0;
     iap_entry (command, result);     
     p0_set_bit(19);
     delay_ms(500);
     p0_clr_bit(19);
      delay_ms(500);
            while(1);

    }}



}
}

Attachments

Outcomes