Missing definitions and need help with USB_LDD

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

Missing definitions and need help with USB_LDD

2,521 Views
bobf
Contributor III

Hi,

 

I tried to use USB Logical Device Driver (USB_LDD) in device mode together with MQX and KwikStik. All documents about USB_LDD and code segments that I can find  are in help content of Processor Expert Manuals, so I copied those code segments from Typical Usage section, and then got the following compilation errors:

 

undefined identifier 'USB_Device_SET_ADDRESS'

 

undefined identifier 'LDD_USB_TSetAddressRequest'

 

undefined identifier 'MAX_INTERFACE_NUMBER'

 

undefined identifier 'MAX_EP_IDX'

etc

 

 

I searched in all files of CW10 and MQX 3.7, and could not find definition of USB_Device_SET_ADDRESS, therefore it looks like that there are support files missing for USB_LDD. It seems not possible for me to proceed further.

May Freescale please give an example of using USB_LDD in device mode together with MQX and Kinetis, or any example of using USB_LDD in device mode? There must exist some code to test USB_LDD when USB_LDD was developed.

Thanks,

bobf

 

 

 

0 Kudos
Reply
7 Replies

1,616 Views
MVa
NXP Employee
NXP Employee

Hi, please find enclosed project that was used in the past to test the USB LDD component.  It could help you with your development. Please note that this project is not official demo project and not all features of the USB_LDD component are used here. We are preparing a few USB demo projects that should be part of the next release.

0 Kudos
Reply

1,616 Views
kirantujare
Contributor IV

Hi Marek,
I need a demo code for USB_LDD.
I could not find the attachment. If possible can you send it again?

0 Kudos
Reply

1,616 Views
brunopaillard
Contributor III

Hi Marek

Could you send me the example code for USB_LDD? (and/or any code that uses the USB_LDD module), I would be interested as well.

Do you know if the USB module on MK22FN512VLH12 has what it takes to detect VBus when it is used as a device? I tried to read the AVBUSVLD bit of OTGSTAT, but that does not seem to work... Or should I use a separate GPIO for that purpose?

Thanks

Bruno

0 Kudos
Reply

1,616 Views
bobf
Contributor III

Hi MVa,

 

Thanks a lot for providing the demo code. I moved on to hack USB PHDC example code, and made a little bit progress there. Anyway, I really appreciate your help here!

 

BTW, I wish there would be a USB demo project for USB Test and Measurement Class. The reason is that Kinetis MCUs have mixed signal capability, and there is need to transfer ADC results to host via USB.

 

Thanks,

bobf

 

 

0 Kudos
Reply

1,616 Views
ProcessorExpert
Senior Contributor III

Hello

 

The USB Logical Device Driver (USB_LDD) is low-level  diver. It is not full USB stack but is intended to provide uniform access to the USB hardware.
In device mode it provides methods to configure Endpoints (DeviceInitEndpoint(..), ..), methods to transfer data through these endpoints (DeviceSendData(...), DeviceRecvData(), ..) and a few methods needed by device configuration and power management.

Bulk, Interrupt and Isochronous endpoint are unidirectional = can be either IN  or OUT -> either DeviceSendData () or DeviceRecvData() can be used in time.
Control endpoint is bidirectional = Both methods DeviceSendData () or DeviceRecvData() are required and these methods must be called by the user from OnDeviceSetupPacket() event.
It is user responsibilty to decode received setup data packet and provide correct response. On typical usage page you can fine code sceleton how to handle OnDeviceSetupPacket() event but the code is application specific e.g. constant MAX_INTERFACE_NUMBER should contain maximal interface number in current configuration etc.

Currently, we are preparing demo projects for USB (e.g. USB mass storage, USB audio device, USB human interface device).

 

Best regards
Jiri Rezler
Processor Support Team

0 Kudos
Reply

1,616 Views
T_M_F
Contributor I

Do you have downloadable USB AUDIO code without MQX?

 

RIchard.

 

0 Kudos
Reply

1,616 Views
addy2000
Contributor I

Hi Jiri,

 

what do you think, how long it takes to get a complete running demo project on USB. For example sendingand receiving strings for a terminal program on PC ?

Best regard Volker

0 Kudos
Reply