mimxrt1170-evk fsl_sai_edma QueueFull error when Queue is not full

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

mimxrt1170-evk fsl_sai_edma QueueFull error when Queue is not full

498 Views
SCh
Contributor II

I have configured USB Audio Speaker. 
Here is tx_callback

static void tx_callback(I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData)
{
	global_var_struct_t *global_var_struct_ptr;
	global_var_struct_ptr = &global_var_struct;

    if (kStatus_SAI_RxError == status)
    {
    }
    else
    {
    	global_var_struct_ptr->free_sai_tx_queue = SAI_TransferGetValidTransferSlotsEDMA(base, handle);
    }
}

 

And in USB Audio Thread I'm requesting to send a new pack of sound data when

if (global_var_ptr->free_sai_tx_queue != 0){

After a random couple of minutes (can be 10 or 30) audio is stopped playing. USB looks like kept working. But when I connected to debug I see this:

    if (handle->saiQueue[handle->queueUser].data != NULL)
    {
    	if (SAI_TransferGetValidTransferSlotsEDMA(base, handle) != 0)
    	{
    		return kStatus_SAI_TxError;
    	}
        return kStatus_SAI_QueueFull;
    }

SCh_0-1684780189910.pngSCh_1-1684780208414.png

SCh_2-1684780269008.png

So there is a queue of 4 elements. There are 2 slots available, and SAI trying to request a transfer on the busy slot.  What could cause this? 

 

Labels (1)
0 Kudos
1 Reply

462 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @SCh ,

  Do you run the RT1170 sdk usb project directly meet the issues?

If yes, please tell me your project path in the SDK, thanks.

   I think, you can refer to this code:

\SDK_2_13_10_MIMXRT1170-EVK\boards\evkmimxrt1170\usb_examples\usb_device_audio_generator

If you use the directly sdk project meet issues, just kindly let me know.

Best Regards,

Kerry

0 Kudos