Reinvoke ISP LPC1788

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Arkadyosh on Tue May 22 23:20:33 MST 2012
I have problem with reinvoke isp command. At start i want imperf when I go into ISP mode by hold P2[10] at low level after reset everything work allright. I create project(~3kB) just to test reinvoke isp with uart. Fisrt, when I use function which call reinvoke isp at the begining of main function uC start ISP handler and I can use flash magic, but there are some limitations... I can use all commands but when I want to program uC with hex file which size is about 170kB flash magic stop after send few bytes and get info: "Operation Failed. (programming - failed to send data to device)". Below function which call reinvoke ISP:

#define IAP_LOCATION (0x1FFF1FF1)

unsigned int iap_command[5];
unsigned int iap_output[5];

typedef void (*IAP)(unsigned int [],unsigned int[]);
IAP iap_entry = (IAP)IAP_LOCATION;

void reinvoke_isp(void)
   iap_command[0] = 57;
   iap_entry=(IAP) IAP_LOCATION;

   iap_entry(iap_command, iap_output);

Second, I try to call ISP after send some special data by uart, but then uC dont go into isp mode. I dont know exacly "where" uC after this command is, becasue dont respond for flash magic commands, but it respond with some strange data when I send something by uart.
I use:
LPC1788, Red Suite 4(NXP Edition), CRP Disabled.
I have stack offset set at topRam - 32.