LPC51U68 Reinvoke ISP in USB Mode is not working

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

LPC51U68 Reinvoke ISP in USB Mode is not working

2,878 Views
seowwoo_quek
Contributor I

HI,

 I followed the UM11071 on page 36 to Reinvoke ISP in USB Mode(4.6.8)but it does not work.

Do I need to add others code to make it work.

I used the lpcxpresso51u68_dev_hid_generic_freertos example and  the LPCXpresso board for LPC51U68

I am able to pass the Cmd 57 and param0 = 2 from my application

the changes are in

USB_DeviceHidGenericCallback function in hid_generic.c

Thanks.

Labels (2)
Tags (1)
0 Kudos
10 Replies

2,338 Views
waynechenicp
Contributor I

I am using usb_device_cdc_vcom_lite example and the following codes work.
 USB_DeviceStop(s_cdcVcom.deviceHandle);
 BOARD_BootClockFROHF48M();
 command[0] = 57;
 command[1] = 2;    // 2: USB
 ((IAP_ENTRY_T)FSL_FEATURE_SYSCON_IAP_ENTRY_LOCATION)(command, result);

 

0 Kudos

2,340 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Seow Woo,

Could you print the status_result[0] below the function? This will help us to know if the command was executed correctly.

Also print the command_param[0] and command_param[1] to know exactly which commands are you using.

Best Regards,

Alexis Andalon

0 Kudos

2,340 Views
seowwoo_quek
Contributor I

Hi Alexis,

I made the printf but I am making use of fsi_iap.c - IAP_ReinvokeISP API. The function iap_entry(command, result)never return to

*status = translate_iap_status(result[0]);

Thanks.

IAP_REinvokeISR.png

IAP_REinvokeISR_1.png

0 Kudos

2,340 Views
seowwoo_quek
Contributor I

Unknown USB1.PNG

0 Kudos

2,340 Views
seowwoo_quek
Contributor I

Hi Alexis,

when I used the iap_flash example. the IAP_ReinvokeISP API works but I need to comment out the

//__disable_irq();

But I need to use the dev_hid_generic_freertos example to enter IAP_ReinvokeISP API . looks like need to do other setting for USB HIB before calling IAP_ReinvokeISP. Can help to find out why?

disable_irq.png

CRP Disable.png

0 Kudos

2,340 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Seow,

The USB API's are in ROM and I suspect the transfer data from the host could cause problems while changing to ISP mode cause this mode also initialize the USB module.

Could you try disabling the USB module before Reinvoke ISP function?

Best Regards,

Alexis Andalon

0 Kudos

2,340 Views
seowwoo_quek
Contributor I

Hi Alexis,

How to do

"Could you try disabling the USB module before Reinvoke ISP function?"

Thanks.

0 Kudos

2,340 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Seow,

Please take a look to this functions:

pastedImage_1.png

Best Regards,

Alexis Andalon

0 Kudos

2,340 Views
seowwoo_quek
Contributor I

Hi Alexis,

i tried all of these functions

USB_DeviceDeinit(g_UsbDeviceHidGeneric.deviceHandle);

 USB_DeviceStop(g_UsbDeviceHidGeneric.deviceHandle);

NVIC_DisableIRQ(USB0_IRQn);

before I call

IAP_ReinvokeISP(2, &status);

The result is the same, I cannot go into USB MSC boot mode. and USB not recognized

usb not recognized.PNG

what is the USB PID and VIP for the USB MSC boot mode?

pid.PNG

0 Kudos

2,340 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Seow,

Could you try first using the StopFunction and after that using the deinit function? Also you could try using the USB_DeviceClassDeinit(uint8_t controllerId) to deinit the stack.

Best Regards,

Alexis Andalon

0 Kudos