USB ROM API Custom Device Class

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB ROM API Custom Device Class

2,101 次查看
mrarkwright
Contributor I

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 interface

0x09, 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, nr2

0x09, 0x05, 0x01, 0x03, 0x40, 0x00, 0x02, 0x00, 0x00,   // EP, out, nr1, interrupt
0x05, 0x25, 0x01, 0x01, 0x01,                           // CS EP, jack1

0x09, 0x05, 0x82, 0x03, 0x40, 0x00, 0x02, 0x00, 0x00,   // EP, in, nr1, interrupt
0x05, 0x25, 0x01, 0x01, 0x02,                           // CS EP, jack2

0x00
};   

标签 (3)
0 项奖励
回复
4 回复数

1,548 次查看
Eli_H
NXP Pro Support
NXP Pro Support

Jannik:

Did you ever get this working?  If so, Can you post your results?

0 项奖励
回复

1,548 次查看
jeremyzhou
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,548 次查看
mrarkwright
Contributor I

Hi jeremyzhou,

I'm using a LPCXpresso4337 evaluation board. So the Chip is a LPC4337.

0 项奖励
回复

1,548 次查看
jeremyzhou
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复