lpcware

re-invoke ISP for USB0 and DFU

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ASCOTJan-H on Tue Jul 15 01:13:17 MST 2014
Hi

We would like to use the DFU tool, to updated our FW and flash the LPC1857 over USB0. To do so we are trying to re-invoke the ISP mode, from application code. If we call our re-invok ISP function, the LPC is detected by the DFU tool as "HIGH SPEED USB" but fails during "Waiting up to 6s for programming algorithm detection after DFU download" with the error message "Board programming algorithm failed to start". If we invoking the ISP with PIN P2_7 we can program the LPC without any problem.

We using:
- a LPC1857 on a custom board with no real access to P2_7
- Keil MCB1800 development board
- LPCXpresso v6.1.2 [Build 177] [2013-11-28]
- dfusec v1.11

Code:
void invokingISPmode(){

  volatile unsigned int i = 0;
  __disable_irq();
  for (i = 0; i < 10000000; i++)
      ;

//Reset register
  LPC_RGU->RESET_CTRL0 = 0x387F1200;
  LPC_RGU->RESET_CTRL1 = 0x17FFF7FF;

  for (i = 0; i < 10000000; i++)
      ;

//Invoke ISP
  unsigned int command[5];
  unsigned int result[4];
  command[0] = 57;
  iap_entry(command,result);

  while(1){
  }
}

We also did try this example -> http://www.lpcware.com/content/forum/lpc1857-jump-usbdfu-bootloader-application
but during "((void(*)(int))0x1040214D)(LPC_OTP_BASE); // Clocks_Init"  The Application runs into the HardFault_Handler.

We do suspect, that some configuration register is not set correctly and causes this behavior. Is there any documentation we can use to see what register need to be set to re-invoke ISP mode from application software?

Outcomes