cold boot LPC1347 USB not initialized

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

cold boot LPC1347 USB not initialized

1,756 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Mon Nov 05 06:51:47 MST 2012
Hi,

We have a composite device that does not seem to be connected to the PC on a cold boot.  We have to reset the device to get it to ennumerate.  It is ennumerated in a soft boot (Windows restart).  Why doesn't it ennumerate automatically on  a cold boot?

EC
0 Kudos
Reply
9 Replies

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Wed Nov 14 22:13:03 MST 2012
[I]> I tried using a two second delay on startup before initializing the USB driver and that seems to be working OK.
> Yes it's powered by the bus.[/I]

The capacity of the VDD regulator on your board wouldn't be enough to charge up capacitors on the VDD rail, quickly. Or you have too large capacitor on the VDD rail. Because of current limit of the VDD regulator, it takes so long until VDD is stabilized. While VDD is rising, USB PLL doesn't lock certainly.

Tsuneo
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Wed Nov 14 06:14:52 MST 2012
If you would have a hardware bus analyzer, it could show better clue.
But if you don't have any, try this test.

Insert a USB hub with external power supply, between the PC and your device.

PC <==> self-powered hub <==> your device

In this setup, cold start the PC.
A self-powered hub supplies 5V to your device, while the PC is in power off.
If it is power supply problem of your board, this setup should stabilize it.

Tsuneo
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by daniel.widyanto on Tue Nov 13 23:32:51 MST 2012
For newer PC, during the cold boot, the BIOS may initiate USB enumeration during POST. Probably the BIOS detecting something wrong with your USB device. Hence, decided to turn off the USB port where your USB device is connected and Windows probably skip that USB port, since the BIOS pass to it in off condition.

Use USB traffic capture to capture cold boot enumeration and Windows enumeration.
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Mon Nov 12 11:21:06 MST 2012
>New assumption is that it takes for a while until VDD supply is stabilized.
Is the device supplied by the USB VBUS?

Yes it's powered by the bus.
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Wed Nov 07 16:57:01 MST 2012
> No, there were no error messages or anything.

I thought It would be caused by the timing around D+ pull-up, but this assumption was denied.

> I tried using a two second delay on startup before initializing the USB driver and that seems to be working OK

New assumption is that it takes for a while until VDD supply is stabilized.
Is the device supplied by the USB VBUS?

Tsuneo
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Wed Nov 07 08:08:13 MST 2012
Thanks Tsuneo!

No, there were no error messages or anything.  It was just "not there" in Device Manager. 

I tried using a two second delay on startup before initializing the USB driver and that seems to be working OK.

EC
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Tue Nov 06 10:52:02 MST 2012
Umm..
I tested NXP_LPC1347_2012_02_22\ROM_USB_cdc example.
I don't see any glitch on D+ line, before pUsbApi->hw->Connect() is called.

> We have a composite device that does not seem to be connected to the PC on a cold boot.

Do you see "Unknown Device" warning on Windows?

Tsuneo
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Mon Nov 05 11:49:44 MST 2012
Hi Tsuneo,

There is a PNP network on the D+ (not our design).  The base signal is on PIO0_6.  There is a note on their schem that says "Soft connect for reenumeration".  The LPC DEMO ROM_USB_CDC will ennumerate with this hardware with a cold boot.  But the heavily modifed demo code for this application doesn't.  Both fw have this init code so I don't know why one works and the other won't?:

[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [B]USB_dev_init[/B]([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]){

[/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032] ErrorCode_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ret;
[/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032] USB_CORE_DESCS_T[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] desc;
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// get USB API table pointer[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT] pUsbApi = ([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]USBD_API_T[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]*)((*([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]ROM[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] **)(0x1FFF1FF8))->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]pUSBD[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// enable clocks and [U]pinmux[/U] for [U]usb[/LEFT]
[/U][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Enable AHB clock to the GPIO domain.[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT] LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (1<<6);

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Enable AHB clock to the USB block and USB RAM.[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT] LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((0x1<<14)|(0x1<<27));

[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Pull-down is needed, or internally, VBUS will be floating. This is to[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// address the wrong status in VBUSDebouncing bit in CmdStatus register (applies to [U]rev[/U] A)[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT] LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO0_3[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~0x1F;
LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO0_3[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (0x01<<0); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Secondary function VBUS[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT] LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO0_6[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~0x07;[/LEFT]
LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO0_6[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (0x01<<0); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Secondary function SoftConn[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f].[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f].[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f].[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][/COLOR][/SIZE]
0 Kudos
Reply

1,715 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Mon Nov 05 09:25:10 MST 2012
Sound like timing issue on start-up initialization around USB.
You'll get more detailed suggestion, when you give a little more information on your board / firmware configuration.

1) External D+ pull-up resistor
Is this resistor a fixed one ?
or is it switched by /USB_CONNECT port pin?

2) USB stack
What is the USB example on which you've started up ?

Tsuneo
0 Kudos
Reply