Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

LPC214x: USB hangs after some hours

2006-01-13 by gcopoix

Hi LPC group,

I have an unnice problem regarding the LPC 214x USB communication:

I've built a project based on the Keil MassStorage example.
The only difference: I changed the descriptor to a non-class device, 
setup 7in/7out pipes (I only use 2 BULK_IN and 1 BULK_OUT, needed 
this amount of declared pipes for descriptor compatibility reasons).
I've also added 1 timer interrupt, and 2 UART interrupts.

1 BULK_IN and 1 BULK_OUT are used as command bulk pipes which are 
used handshaked (means every command written is answered).

In application level (non-interrupt driven, called by main loop) I 
check if I received some data e.g. over UART. The UART is buffered by 
a ringbuffer (ISR -> ringbuffer) and the application sends the 
received data from ringbuffer->USB (calling USB_WriteEP()).

Now the problem: This works OK for several hours, but then mostly in 
WrCmd() after writing CMD_CODE the while-loop waiting for CCEMTY_INT 
doesn't leave, resulting in a hanging USB communication.

I've seen a hanging situation also in the USB ISR after setting 
EP_INT_CLR and waiting for CDFULL_INT.

I tried to disable the USB interrupt while calling USB_WriteEP() - 
same result (may be a bit better, but can't say exactly).
I also tried to send only within an USB interrupt (SOF irq), same 
result too.

So my questions:
- Does anybody else have this problem ?
- What can be the reason for a non-accepted CMD_CODE or a
  non-accepted write to EP_INT_CLR ?
- What to I need to take care of before calling USB_WriteEP() ?
- Is it forbidden to send by application level ?
- Is there a patch for the Keil USB stack ?
- Is there some errata about this ?
- What can I do to prevent this or what to resolve this situation ?

Thank you for your help

Gregor

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.