Hi!
I'm trying to use LPC4357 USB device without class support (HID, CDC, MSC e.t.c.) in MDK-4.72a. It looks like the standard RL-USB sources do not allow doing that: when I uncheck all checkboxes (class support) in the USB configuration file usb_config_USB0.c, the compiler show an error message line "size of array cannot be zero" or something like that (because USBD_IF_NUM definition becames 0 if no class is selected).
The only thing I need is one BULK IN & one BULK OUT endpoints for thansfers between ARM & PC (I'm using WinDriver 10.21 on the PC for USB support). I have done that on LPC2148, but then I had complete code sources of the USB driver. Unfortunately LPC4357 USB library comes in .LIB-file USB_CM3.lib and there is no way to edit it.
Is there a simple way to disable any class support in the USB device without complete editting of the source code of the driver?
I tried to use CDC ACM class for raw packet endpoint transfers but I got an issue: OUT packets are normally received by ARM (using fnc. USBD_CDC_ACM_DataAvailable & USBD_CDC_ACM_DataRead), but IN packets (sent by USBD_CDC_ACM_DataSend) are not received by the PC: USB driver on the PC side shows a BABBLE_DETECT error when I try to read out a packet (don't know what exectly that means).
An ideal solution for me would be the ability to simply handle EVT_BULK_IN & EVT_BULK_OUT events for an endpoint and transfer data packets using USB_WriteEP & USB_ReadEP low-level functions. But I couldon't find a mechanism of catching these events correctly.
Has anyone experienced such a problem? Thanks in advance.
Ah, you are working on RL-RTX-USB.
In the USBD_RTX_EndPoint2 task, there are two "waits", which block the task. Single "wait" minimizes timing interference between IN and OUT EPs.
__task void USBD_RTX_EndPoint2(void) { while(1) { if ( os_evt_wait_or( USBD_EVT_OUT | USBD_EVT_IN, 0xffff ) == OS_R_EVT ) { switch ( os_evt_get() ) { case USBD_EVT_OUT: // // come to here by OUT EP2 completion // break; case USBD_EVT_IN: // // come to here by IN EP2 completion // break; } } } }
Tsuneo
Yes, you're right about minimize timing.
I just wanted to pay attention to the need of waiting for USBD_EVT_OUT event before any read operation, and USBD_EVT_IN event after any write operation.