Reinvoke ISP LPC1788

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

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

0
您的评定:

评论查看选项

选择你喜欢的显示评论的模式,并点选“储存设置”,以启用你所做的变更。
Daniel Widyanto的头像
Daniel Widyanto
离线
Joined: 2011-06-28
帖子: 66

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

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

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

Lien.Nguyen
离线
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,
Lien

feedback