I am looking for an example or documentation on creating a custom USB device class with the MDK Pro Pack Middleware v6.1.0 for the NXP LPC43xx series processor. When I look at the documentation accessible by double clicking on the USB component class icon and navigate to "USB Device->USB Device Examples->Custom USB Device" I am greeted with a helpful "More information coming soon" page.
Furthermore the documentation on the Device Class Functions is not very helpful or thorough in providing any help in designing a custom device using the MDK-Pro Middleware's USB library.
At the moment the device will show up in windows but a USB Device Not Recognized balloon pops up. On sniffing the bus traffic I see that the device never responds to a GET_DESCRIPTOR Setup packet request. Where does this need to get implemented? I thought that using the wizards associated with USBD_Config_CustomClass.h and USBD_Config.c would configure the proper information and then let the library handle descriptor requests. Unfortunately there is NO Documentation to tell me if that is correct or not.
Any documentation or example code would be much appreciated!
Wild,
Starting from a basic project and adding the USB class with the stuff written in your reply I was still unable to get the USBD_CustomClass0_Endpoint1_Event call back. I have uploaded a simple project for the MCB4357 board which exhibits the problem. When I build a similar project for the LPC1549 chip I do receive callbacks. Is there something different that I need to be doing with the LPC4357? The USB stack does operate and the device does enumerate with the LPC4357, but as I have said when the data is transferred to the chip I never get a callback.
www.filedropper.com/blinkyulp (sorry the link looks very questionable but it is legitimate)
Can you first try the original HID and Mass Storage example to see that they work and then build on one of those.
Can you please share what was the problem/solution to help people in future having similar problems?
The problem it seemed boiled down to the third parameter of the USBD_EndpointRead call matching the endpoint size so:
// High Speed Devices USBD_EndpointRead(0, USB_ENDPOINT_OUT(1), class0_bulk_out_buf, 512); // Full Speed Device USBD_EndpointRead(0, USB_ENDPOINT_OUT(1), class0_bulk_out_buf, 64);
Thanks for sharing.