Reinvoke ISP LPC1788

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reinvoke ISP LPC1788

1,028 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Arkadyosh on Tue May 22 23:20:33 MST 2012
Hello,
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)
{
   __disable_irq();
   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.

Thanks,
Arkadyosh
Labels (1)
0 Kudos
2 Replies

588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Lien.Nguyen on Wed Oct 10 19:48:00 MST 2012
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,
Lien
0 Kudos

588 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Mon Oct 08 21:18:00 MST 2012
Hi,

The current rev of LPC177x and LPC178x has issue with baud rate bigger than 57600bps. See http://www.nxp.com/documents/errata_sheet/ES_LPC177X_8X.pdf

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 http://www.lpcware.com/content/blog/reinvoke-isp-user-code-example-lpc177x-lpc178x for simple example on reinvoking ISP from user program
0 Kudos