LPC11U24 and IAP Reinvoke ISP

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

LPC11U24 and IAP Reinvoke ISP

1,286 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tarmo on Fri May 18 04:05:55 MST 2012
Hi

How do i start ISP as MSC USB device on LPC11U24 using IAP Reinvoke ISP command (57).  The following code works well on LPC1343 but not on LPC11U24.
I can execute ISP as USB MSC device during reset or power on (PIO0_1 low & PIO0_3 high).

All other IAP commands are working well. So i think the problem is with init_msdstate() function.

#define IAP_LOCATION 0x1fff1ff1
typedef void (*IAP)(unsigned int[], unsigned int[]);
IAP iap_entry = (IAP) IAP_LOCATION;
#define CMD_SUCCESS 0

unsigned int Command[5];
unsigned int Result[4];

#define init_msdstate() *((uint32_t *)(0x10000054)) = 0x0

void EnterISP(void) {
/* make sure USB clock is turned on before calling ISP */
LPC_SYSCON->SYSAHBCLKCTRL |= 0x04000;
/* make sure 32-bit Timer 1 is turned on before calling ISP */
LPC_SYSCON->SYSAHBCLKCTRL |= 0x00400;
/* make sure GPIO clock is turned on before calling ISP */
LPC_SYSCON->SYSAHBCLKCTRL |= 0x00040;
/* make sure IO configuration clock is turned on before calling ISP */
LPC_SYSCON->SYSAHBCLKCTRL |= 0x10000;
/* make sure AHB clock divider is 1:1 */
LPC_SYSCON->SYSAHBCLKDIV = 1;

/* Send Reinvoke ISP command to ISP entry point*/
Command[0] = 57;

init_msdstate(); /* Initialize Storage state machine */
/* Set stack pointer to ROM value (reset default) This must be the last
piece of code executed before calling ISP, because most C expressions
and function returns will fail after the stack pointer is changed. */
__set_MSP(*((uint32_t *) 0x1FFF0000)); /* inline asm function */

/* Enter ISP. We call "iap_entry" to enter ISP because the ISP entry is done
through the same command interface as IAP. */
iap_entry(Command, Result);
// Not supposed to come back!
}
Labels (1)
0 Kudos
Reply
3 Replies

1,100 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kpa on Fri Jun 08 03:22:25 MST 2012
Yes it works nicely when using PIO0_1, but I would like to start this mode from my own program.
The code from this post doesn't work... any idea why ?

kpa
0 Kudos
Reply

1,100 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drs on Thu May 24 09:35:39 MST 2012
ISP is supported via USB only when VBUS is active.

See 20.3 Features in the UM:

The LPC11U2x supports ISP from the USB port through enumeration as a Mass
Storage Class (MSC) Device when connected to a USB host interface (Windows
operating system only)
0 Kudos
Reply

1,100 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kpa on Thu May 24 07:08:02 MST 2012
Interesting question.

I have checked the datasheet and it seems that this will invoke the UART ISP not the USB MSC one...
There is no code to reinvoke USB MSC ISP so it could be that PIO0_3 is also sampled or another undocumented IAP command should be used...

Help from NXP will be welcome !

kpa
0 Kudos
Reply