lpcware

[Solved] LPC824 re-invoking ISP

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ArneB on Thu Jan 15 08:16:05 MST 2015
For the archive and anyone, who might have troubles re-invoking the ISP mode on the LPC824:

Don't forget to disable your DMA controller, if you are executing the "re-invoke ISP" IAP command !

Otherwise the bootloader and the still active DMA controller are fighting for the incoming UART bytes, resulting in a non-working ISP mode.

This is the way I have done it:


typedef enum {READ_PART_ID           = 54,
      READ_BOOT_CODE_VERSION = 55,
      REINVOKE_ISP           = 57,
      READ_UID               = 58} IAP_COMMANDS_T;

void do_iap(IAP_COMMANDS_T iap_command) {
  command[0] = (uint32_t) iap_command;
  if(iap_command==REINVOKE_ISP) LPC_DMA->CTRL = 0; // Disable DMA controller
  __disable_irq();
  iap_entry(command, result);
  __enable_irq();
}

Outcomes