Bare Metal USB Stack - USB_Class_Audio_Send_Data not ready

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

Bare Metal USB Stack - USB_Class_Audio_Send_Data not ready

Jump to solution
687 Views
deek
Contributor I

I’m implementing a KL25 USB device based on the following example:

Freescale_BM_USB_Stack_v5.0\Src\example\device\audio\generator

The example waits for enumeration, then calls USB_Class_Audio_Send_Data() in a loop.  This appears to work fine unless the stack is not ready for the next packet (this depends on the host latency).  I cannot find a callback or a method to poll that tells me it is safe to call USB_Class_Audio_Send_Data().  I think I can poll the OWN bit in the BDT, is there an easier way?

Labels (1)
0 Kudos
1 Solution
517 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Deek,

For the Audio send/receive, there are two conditions needs before they can be called.

  1. ISO transfer has an interval parameter, so APP needs to make sure the internal between two send/receive is called match the ISO transfer interval
  2. The second call needs to wait the previous call is done, that’s  USB_DEV_EVENT_SEND_COMPLETE.

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
517 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Deek,

I am sorry, but I dont understand "This appears to work fine unless the stack is not ready for the next packet (this depends on the host latency). " would you please explain your concern in details? Thanks for your patience!


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
517 Views
deek
Contributor I

Kan,

Thanks for the reply.  My question is the proper usage of USB_Class_Audio_Send_Data().  Does this call block until the data is sent, or do I need to wait for a notification that I can send more data?  If I need to wait for a notification, is that USB_DEV_EVENT_SEND_COMPLETE or something else? The USB_Stack_Device_Reference_Manual.pdf is not clear.

Regards...

0 Kudos
518 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Deek,

For the Audio send/receive, there are two conditions needs before they can be called.

  1. ISO transfer has an interval parameter, so APP needs to make sure the internal between two send/receive is called match the ISO transfer interval
  2. The second call needs to wait the previous call is done, that’s  USB_DEV_EVENT_SEND_COMPLETE.

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos