USB1 HS with LPC540XX

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

USB1 HS with LPC540XX

1,168 Views
mb15
Contributor I

Hello all,
I want to use the USB1 HS interface of the controller LPC54S005 on an own board.
I have copied SDK examples for USB of the development board LPC54018 and modified them accordingly.

In the file usb_device_config.h I set HS to 1 and FS to 0.

#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)

And in the void APPInit(void) function I set the speed to high.

s_cdcVcom.speed = USB_SPEED_HIGH;

The board reports as high speed USB on my PC, but it does not return a device descriptor. Under Linux with dmesg the following error message comes up:

[31059.292763] usb 1-5: USB disconnect, device number 71
[31062.726683] usb 1-5: new high-speed USB device number 72 using xhci_hcd
[31068.018710] usb 1-5: device descriptor read/64, error -110
[31083.634185] usb 1-5: device descriptor read/64, error -110
[31083.870313] usb 1-5: new high-speed USB device number 73 using xhci_hcd
[31089.010208] usb 1-5: device descriptor read/64, error -110
[31104.625831] usb 1-5: device descriptor read/64, error -110
[31104.734173] usb usb1-port5: attempt power cycle
[31105.385792] usb 1-5: new high-speed USB device number 74 using xhci_hcd
[31110.641693] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[31116.017555] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[31116.225318] usb 1-5: device not accepting address 74, error -62
[31116.353321] usb 1-5: new high-speed USB device number 75 using xhci_hcd
[31121.393226] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[31126.769304] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[31126.977266] usb 1-5: device not accepting address 75, error -62
[31126.977349] usb usb1-port5: unable to enumerate USB device

 

In the program code the function USB_DeviceCallback is called once, for the event kUSB_DeviceEventBusReset. After that no more callback is triggered.

I would be very grateful if someone could give me a hint what the problem could be. With the flashloader program I can change the firmware of my board via USB1. Therefore I think that the hardware is ok.

Best regards
Laura

0 Kudos
5 Replies

1,142 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi mb15 

LPC54S005 SDK includes USB device code. You don't need port it from  LPC54018 .

Please download LPC54S005 from 

https://mcuxpresso.nxp.com/en/select

For Device demo: to change USB0 to USB1, we only need to change file usb_device_config.h as:

/*! @brief LPC USB IP3511 FS instance count */

#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)

/*! @brief LPC USB IP3511 HS instance count */

#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)

This is enough.

Please test it with a LPC54S005 SDK demo code.

Thanks,

Jun Zhang

0 Kudos

1,087 Views
mb15
Contributor I

Hello Jun Zhang,

Thank you very much for your answer!


Unfortunately I didn't find a sample program for USB with SD card in the SDK of processor LPC54S005. I find this only in SDKs of development boards.
But I saw that in Peripheral Tool you can configure USB MSC Ram and get already a lot of USB code for processor LPC54S005. I tried to modify this code to access the SD card via MSC, which finally led to the error message again.

 

In another test, I simply changed the pins in the sample program for processor LPC54018 to match my board. The code also runs on my processor LPC54S005 and the example works

0 Kudos

1,080 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Thanks for the sharing.

Which LPC54018 SDK demo code do you use?  

0 Kudos

1,074 Views
mb15
Contributor I

I am using the example: lpcxpresso54s018_dev_msc_disk_bm

0 Kudos

1,070 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Thanks!

0 Kudos