LPC54628 USB host example

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

LPC54628 USB host example

Jump to solution
4,407 Views
changlin_ren
Contributor II

I work on USB0 host programming on a LPC54607 controller.
I have a demo board OM13098 (LPC54628) and run example code < lpcxpresso54628_host_msd_fatfs_bm > to prove concept. I am using USB0 FullSpeed on J3 and have a usb micro AB cable connect to the board and have USB 2.0 A female to A female attached to the USB A cable so I can plug in a USB thumb drive in it.
I set break points in usb_host_ohci.c line 2690 and 2706 to listen on
USB_HOST_OHCI_EVENT_ATTACH/USB_HOST_OHCI_EVENT_DETACH events. The issue is when I plug/unplug the thumb drive, I cannot get the breakpoint.

Can anyone point what wrong with my process? I appreciate for any input.

0 Kudos
Reply
1 Solution
4,278 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

We do apologize for the delay on this one.

We cannot find anything regarding the "VBUS Device only function" note.

Still, VBUS is required by USB standard, meaning this signal should be given to the Host and Device.

We will go back to our position of "Could be that the RM is referring to the usage of VBUS registers" and not that the Host does not need the signal at all. As said before, by USB standard, all 4 signals (VBUS, D+, D- and GND) are required [Page 17, Section 4.2.1 Electrical, Universal Serial Bus Specification, Rev 2, 04/2000].

Thanks for your patience, let us know if this information is helpful or not. 

View solution in original post

0 Kudos
Reply
12 Replies
3,860 Views
changlin_ren
Contributor II

Hello Pawan,
Thank you for reply on my post! 

Yes, I am able to run the example with USB FS(J3) on LPC54xxx Demo board, I took the exactly steps ZhangJennie provided in your original post. My issue was from one of our production board.

To test <lpcxpresso54628_host_msd_fatfs_bm>, first set break points under 'kUSB_HostEventAttach' and 'kUSB_HostEventDetach' in USB_HostEvent(), you should see the code break when you plug/unplug a USB drive from J3 port.
If you can break on above break points, then set break points in host_msd_fatfs.c to step through the rest of the example code.
If you cannot see the breaks, goto usb_hostohci.c set break point under USB_HostOhciTaskFunction() to find out what is the root cause.

Good luck!
Changlin

3,852 Views
PawanNXP
Contributor II

Hello Changlin Ren,

Thanks for your response and the suggestion.

I was able to make USB FS work, was missing a jumper setting (JP10 needs to be connected).

Appreciate your reply..

Pawan

 

 

0 Kudos
Reply
4,375 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

USB_VBUS is for monitoring the voltage on the USB bus. As said in the datasheet "Monitors the presence of USB0 bus power" [Page 20, Table 4, LPC546xx Product sata sheet, Rev 2.8, 09/2020].

The Reference Manual says the following:

"This bit indicates if VBUS is detected or not. The bit raises immediately when VBUS becomes high. It drops to 0 if VBUS is low for at least 3 ms. If this bit is high and the DCon bit is set, the hardware will enable the pull-up resistor to signal a connect" [Page 915, Table 893, UM10912
LPC546xx User manual, Rev 2.4, 11/2019].

Please, let us know if this information is helpful or not.

0 Kudos
Reply
4,367 Views
changlin_ren
Contributor II

Thank you Daniel!

I noticed that the following quote is from chapter 37 for USB0 device controller.
"This bit indicates if VBUS is detected or not. The bit raises immediately when VBUS becomes high. It drops to 0 if VBUS is low for at least 3 ms. If this bit is high and the DCon bit is set, the hardware will enable the pull-up resistor to signal a connect" [Page 915, Table 893, UM10912
LPC546xx User manual, Rev 2.4, 11/2019].

From Chapter 38 Table 907, it says USB0_VBUS is "Device only function."  Why the example code needs to config this pin for USB host?

 

0 Kudos
Reply
4,352 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Hi,

VBUS should be used in the internal circuitry for USB (for D+ and D-), meaning that if VBUS is not entering the system, the circuitry is not being supplied.

Could be that the RM is referring to the usage of VBUS registers, but not the signal itself. Still, let us confirm what that note is for.

Please, let us know if this information is helpful or not.

4,345 Views
changlin_ren
Contributor II

Thank you Daniel. 

Please let me your findings.

0 Kudos
Reply
4,279 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

We do apologize for the delay on this one.

We cannot find anything regarding the "VBUS Device only function" note.

Still, VBUS is required by USB standard, meaning this signal should be given to the Host and Device.

We will go back to our position of "Could be that the RM is referring to the usage of VBUS registers" and not that the Host does not need the signal at all. As said before, by USB standard, all 4 signals (VBUS, D+, D- and GND) are required [Page 17, Section 4.2.1 Electrical, Universal Serial Bus Specification, Rev 2, 04/2000].

Thanks for your patience, let us know if this information is helpful or not. 

0 Kudos
Reply
4,274 Views
changlin_ren
Contributor II

Thank you Daniel for the clarification. I agree with you "by USB standard, all 4 signals (VBUS, D+, D- and GND) are required".

For "VBUS Device only function", please double check USB0_VBUS pin description in 'Table 907. USB Host pin description' [Page 932,  Chapter 38: LPC546xx USB0 Full-speed Host controller, UM10912  LPC546xx User manual, Rev. 2.4 — 11 November 2019]

Please update USB0_VBUS pin description to clear the confusion.

4,257 Views
Daniel-Aguirre
NXP TechSupport
NXP TechSupport

Thanks for your patience.

We will send our comments to the documentation team.

Again, thanks for your patience

0 Kudos
Reply
4,249 Views
changlin_ren
Contributor II

Thank you Daniel for the helps!

0 Kudos
Reply
4,391 Views
changlin_ren
Contributor II

After reinstall and update MCUxpresso to v11.6.1 and upgrade SDK to 2.12.0, I figured out a way to make lpcxpresso54628_host_msd_fatfs_bm and lpcxpresso54628_host_hid_mouse_bm working.

What I found that if I comment out USB0_VBUS configuration(pin_mux.c line 93), the code does not work, I looked at LPC546xx user manual the USB_VBUS is for device function only. can anyone explain it to me? Thank you!

0 Kudos
Reply
3,883 Views
PawanNXP
Contributor II

Hello,

I am facing a similar problem. Am trying to run the fatfs example with USB FS. Code is stuck at "host init done". Please check this thread

Were you successful in running the example with USB FS?

Thanks,

Pawan

0 Kudos
Reply