NOTICE: This website will be shut down in the near future. Product content has moved to Forum content and FAQs have been moved to We encourage you to create a user account on to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.


LPCUSBLIB Stuck in infinite loop inside Pipe_WaitUntilReady

2 replies [Last post]
Joined: 2013-12-02
Posts: 35

After porting the example contained in "lpcusblib_MassStorageHost" in lpcopen, with debug macro "LPCUSBlib_DEBUG" turned on, my processor gets stuck in an infinite loop inside of Pipe_WaitUntilReady.

My Setup:
Chip: LPC4357
USB Mass Storage on USB1
C++ project (directly compiling in lpcusblib, NO static library dependencies -- issues have been raised in the forums about how the IDE reports syntax errors in the LPCUSBLIB source code, but still compiles)

Debug console output:

Device Attached on port 1

Mass Storage Device Enumerated.
        .../lpcusblib/Drivers/USB/Core/HCD/EHCI/EHCI.c: 336
        Evaluated HCD_STATUS = 31
        .../lpcusblib/Drivers/USB/Core/HCD/EHCI/EHCI.c: 379
        Evaluated HCD_STATUS = 31
HcdGetPipeStatus... (repeated infinitely)


I have absolutely no idea why the pipe handle comes back as invalid. I am using RAM5 as my USBRAM_SECTION which aliases to RamAHB32, and nothing else in my project is using this bank. Has anyone run into a situation like this before and can offer some help?

Your rating: None

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2015-07-01
Posts: 8

I ran into the same problem with the LPCUSBlib_MassStorageHost example on a LPC4357 as well. I have not yet found a solution sadly.

In my case I could insert a flash drive into USB1 and read/write files on it. My problem was when I unplugged the flash drive and then re-inserted it. The code would get stuck in an infinite loop as you say.

I've been unable to work on it again until now.

here is a link to my original post:

Joined: 2013-12-02
Posts: 35

Thanks for the info iemc. I'll update this thread if I find a solution.