LPC1768, problem wiht f/w download , use iap reinvolk isp command and flashmagic

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by yeqing85123 on Fri Jul 11 01:21:47 MST 2014
        At first, sorry about my poor English.
        My problem is :
        I want to download f/w without reset  mcu and set  P2[10]  to low,So I use the IAP RE-INVOKE ISP command.But when I start the flash magic , it shows "Failed to autobaud - step 1" just after the command sent.
        Bellow is the code which I invoke the command( according http://www.lpcware.com/content/blog/reinvoke-isp-user-code-example-lpc177x-lpc178x for simple example):

static unsigned int iap_cmd[5];
static unsigned int iap_ret[4];
//  IAP Command
typedef void (*IAP)(uint32_t *cmd,uint32_t *result);
IAP iap_entry = (IAP) 0x1FFF1FF1UL;
static void restart_isp(){
LPC_SC->PLL0CON   = 0x00;  // disable PLL        
  LPC_SC->PLL0FEED  = 0x55;

LPC_SC->CLKSRCSEL = 0; // select  IRC
        LPC_SC->CCLKCFG   = 1;

       /* Set stack pointer to ROM value (reset default) */
       __set_MSP(*((uint32_t *) 0x1FFF0000));

iap_cmd[0] = 0x57; // RE-INVOKE ISP Command
        iap_entry(iap_cmd,iap_ret);        // Call IAP Command
return ;