LPC1837 And USB1 FS Device Enumeration.

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

LPC1837 And USB1 FS Device Enumeration.

599 Views
workalot
Contributor II

Workalot is stuck getting a CDC VCP up and running. At this point I get to the where an address is set, but when Windows asks for the configuration descriptor (67 bytes) the first 64 bytes arrives and not the remaining 3 bytes.

So, my understanding of DQHs and DTDs needs edification.

Does a one setup of DTD cover all 67 bytes or are two setups required?

At UM10430 Rev 3.0, sec 23.10.11.2, page 611 the instruction "3. Fill in total bytes with transfer size." Would this be 67? Or 64?

I have tried both ways but only 64 bytes gets the the PC (as per MMA log). 

I should add that I eschew demo libraries and favour roll your own.

Thanking in advance,

5 Replies

406 Views
workalot
Contributor II

Thank you Carlos Mendoza for your suggestion.

But persistence has prevailed. Enumeration and data flow is about. All very pleasing.

The issue about EP0 OUT data mentioned above wasn't an issue after all, the delivered data was all zeros being fed in an already zeroed buffer (pays to fill the buffer with 0xCD first).

And once I bothered to look at EP2 OUT's dTD status bits which had an buffer error the fault was quickly located to bad dQH address.

Thank you, Workalot.

406 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Workalot,

 

Thanks for your response, it is good to hear the problem was fixed.

Best Regards!
Carlos Mendoza
Technical Support Engineer

0 Kudos

406 Views
workalot
Contributor II

To partially answer my own question - 67 is the answer. The 67 bytes is being delivered but still the enumeration flounders.

Since 67 bytes is less than wLength's 0xFF bytes asked for, an IN ZLP is required which I do fill in a DTD for and prime EP0 IN for transmission. But in spite of enabling IOC, I'm not seeing an interrupt. Is this normal?

I suspect all answers are in the USB0/USB1 sections which I have read, reread and reread some more. Guess I'll reread again.

0 Kudos

406 Views
workalot
Contributor II

Today's report is that once the thinking cap was on and EP0 OUTs prepared, enumeration resulted and the CDC VCP is seen to be present under Device Manager.Ports as a serial device.

Next drama is the reading of EP OUT data. How is it done?

When a control write to 'Set Line Coding' is captured and the expected 7 bytes is reported, how is the data then extracted?

 I've tried loading the DTD's 'BUFFER POINTER PAGE 0' with a file scope buffer (aligned to 4 bytes), but no go.

Quite happy to post code, messy as it is.

And, to correct a miss-statement above, an IN ZLP is required if the amount of data is less than the host asked for AND if that amount of data is a multiple of the MAX_PACKET_SIZE.

0 Kudos

406 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Workalot,

Have you considered using the USB device rom examples that come with LPCOpen? The example usbd_rom_cdc_vcom shows how to use the USBD ROM stack to create a virtual comm port.

LPCOpen Software for LPC18XX|NXP 


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos