ReinvokeISP MSC fails when USB is used in firmware

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

ReinvokeISP MSC fails when USB is used in firmware

654 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kalfalfa on Tue Apr 24 14:07:53 MST 2012
Hi,

I'm using LPC1343.

In my firmware, I'm using the ROM USB HID driver. I would like to be able to disconnect this USB device (SoftConnect), and then call ReinvokeISP and have the device come back up as a Mass Storage device for firmware programming.

ReinvokeISP works fine if called before I initialize and connect the ROM USB HID driver - but if called after the device is already initialized/enumerated/etc. with the ROM USB HID, it fails.

What I do is:
1. Disconnect USB using '(*rom_sec0)->pUSBD->connect(FALSE);' Which is working - device detach is detected.
2. Call IAP_ReinvokeISP(); - the device enters the ISP firmware and USB connects, but windows show 'Unknown USB device'.

My USB analyzer shows that Windows is trying to read the USB device descriptor, but the device just NAKs forever.

I suspect that something in the USB SIE is in a bad state. What are the required steps to bring the USB system into a known good 'reset' state manually, so that a subsequent connect and enumeration as a completely different device will work?

Thanks,
-Patrick
0 Kudos
Reply
5 Replies

625 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kalfalfa on Mon May 07 13:27:37 MST 2012
Ok, I managed to get it working - I was calling __disable_irq(); for some reason right before calling ReinvokeISP. Removing this call seems to have fixed things.

-Patrick
0 Kudos
Reply

625 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kalfalfa on Mon May 07 13:21:45 MST 2012
Hi,

Still not able to get this to work.

I'm clearing the memory at 0x10000054 as specified in the Manual. I also wait seconds between soft-disconnect -> ReinvokeISP.

Windows sees the new device properly - it is enumerated properly as a new device. The first thing that windows does is a getDescriptor message, which the MSC firmware responds to with NAKs forever. As I've said - I think that something needs to be cleared in the SIE - I'm just not sure what.

-Patrick
0 Kudos
Reply

625 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by researchinnovation on Wed May 02 21:55:26 MST 2012
@Kalfalfa...!!!

Hi..!!
What modification have you made in your code.

Thanks & Regards...!!!:)
0 Kudos
Reply

625 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Wed May 02 13:09:21 MST 2012
First, read the LPC1343 errata on uninitialized variable related to USB ISP.
Second, wait a few seconds after soft-disconecting and before reinvoking ISP. Windows doesn't like USB devices to be reconnected too fast.
0 Kudos
Reply

625 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kalfalfa on Wed May 02 11:03:29 MST 2012
Does anybody have any ideas about this?

How do I always manage to ask the questions that get no replies? :-P

-Patrick
0 Kudos
Reply