I'm implementing a USB MIDI device. My in-endpoint works fine but i can't get the out-endpoint to receive data. I registered my endpoint handler with
USBD_API->core->RegisterEpHandler(g_hUsb, 2, epOutHandler, NULL);
As per documentation the handler should receive USB_EVT_OUT events and USB_EVT_OUT_NAK events should be deactivated by default. However my handler is only ever called with USB_EVT_OUT_NAK and never with USB_EVT_OUT.
Also, is my approach correct to read the received data with
USBD_API->hw->ReadEP(hUsb, 0x01, pData);
in my handler whenever it is called with an USB_EVT_OUT event?
This is my configuration descriptor in case it matters:
ALIGNED(4) uint8_t USB_ConfigDescriptor[] = {
0x09, 0x02, 0x44, 0x00, 0x01, 0x01, 0x00, 0x80, 0x3C, // Config, 1 interface0x09, 0x04, 0x00, 0x00, 0x02, 0x01, 0x03, 0x00, 0x03, // Interface0, 2 EPs, Audio, Midi
0x07, 0x24, 0x01, 0x00, 0x01, 0x32, 0x00, // CS Interface (midi)
0x06, 0x24, 0x02, 0x01, 0x01, 0x00, // jack, in, embed, nr1
0x09, 0x24, 0x03, 0x01, 0x02, 0x01, 0x01, 0x01, 0x00, // jack, out, embed, nr20x09, 0x05, 0x01, 0x03, 0x40, 0x00, 0x02, 0x00, 0x00, // EP, out, nr1, interrupt
0x05, 0x25, 0x01, 0x01, 0x01, // CS EP, jack10x09, 0x05, 0x82, 0x03, 0x40, 0x00, 0x02, 0x00, 0x00, // EP, in, nr1, interrupt
0x05, 0x25, 0x01, 0x01, 0x02, // CS EP, jack20x00
};
Hi Jannik Theiß,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Before answer your question, I was wondering if you can tell what exactly chip you use.
Have a great day!
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi jeremyzhou,
I'm using a LPCXpresso4337 evaluation board. So the Chip is a LPC4337.
Hi Jannik Theiß,
Thanks for your reply, and I was wondering if you can share the demo, then I can replicate the issue on my board.
I'm looking forward to your reply.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------