LPC1837 USBD Custom Class driver help

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

LPC1837 USBD Custom Class driver help

644 Views
michbound
Contributor I

Hello all, 

 

I am trying to create a custom class driver using USBD by following the bwtest example... 

 

Some Background:

I am working on a project that requires dumping 1 Mega samples / sec of 16 bit ADC values using the HS USB peripheral on the LPC1837 device...

 

I have been trying to modify the USBD bwtest example to achieve this but am running into a number of problems - I am guessing mainly due to my lack of understanding around how the USBD stack works...

 

Question:

The bwtest example defines a transfer descriptor structure as shown below

/* dTD Transfer Description */
typedef volatile struct {
volatile uint32_t next_dTD;
volatile uint32_t total_bytes;
volatile uint32_t buffer0;
volatile uint32_t buffer1;
volatile uint32_t buffer2;
volatile uint32_t buffer3;
volatile uint32_t buffer4;
volatile uint32_t reserved;
} DTD_T;

 

It seems each buffer (0..4) points to 4096 bytes of data... What if I want to create a buffer with only 512 bytes of data? I am guessing the DTD structure is something hard coded in the USBD stack so I need to follow the same structure format and cannot change the mechanics around how the buffers are processsed?

 

 I have a circular buffer setup with 512 byte frames so it would make life a lot simpler if I could process data in 512 byte chunks...

 

Attached is the bwtest example if that helps...

 

Thanks

Jay

Original Attachment has been moved to: bwtest.rar

Labels (2)
0 Kudos
1 Reply

304 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the below threads and let me know if this helps.

nxpUSBlib with windows WinUSB driver custom class | www.LPCware.com 

USB DMA Engine Bulk Transfer in Custom Class | www.LPCware.com 

USBD ROM API with custom class | www.LPCware.com 


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos