Reinvoke ISP LPC1788

2 replies [最新文章]
Joined: 2012-04-24
帖子: 8

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.




Daniel Widyanto的头像
Daniel Widyanto
Joined: 2011-06-28
帖子: 66


The current rev of LPC177x and LPC178x has issue with baud rate bigger than 57600bps. See

Also, if you call the ISP from user code, make sure that the system clock is running from 12Mhz IRC again. Otherwise, please supply the correct system clock in the ISP program settings (eg. FlashMagic has Oscillator(Mhz) field to indicate the bootROM ISP the current system clock)

See for simple example on reinvoking ISP from user program

NXP Application Support
If it works for you, please post it back in the forum =)

NXP Application Support
If it works for you, please post it back in the forum =)

Joined: 2011-09-20
帖子: 49

Hi Arkadyosh,
If you only have trouble with programing uC, I think the problem may be the hex file.

I met this error when I try using flash magic to download code on RAM. When downloading, ISP Handler uses a portion of RAM for its operation. If your code is placed on this region, you will get the error you said.

Best Regards,