Post Go back to editing

ADSP-BF706 with audio codec CS4272 via SPORT


I am trying to get data from audio codec CS4272 via SPORT. CS4272 works in stand alone master mode, so it's generating all clocks it self, Frame clock, Serial clock and also master clock. data in I2S format, you can see it on picture.

Now codec Frame clock(LRCK on picture) is connected to ADSP-BF706 SPT1_AFS pin directly, SCLK connected to SPT1_ACLK, and SDATA pin connected to SPT1_AD0. Could you please help me and explain How to configure SPORT correctly to get data from both channels? i Will provide some code that i did myself but it's not working properly.


ADI_SPORT_HANDLE          hDeviceRx;

unsigned char sport_handlerRx[SPORT_MEM_SIZE];

adi_sport_Open(1U,ADI_HALF_SPORT_A,ADI_SPORT_DIR_RX, ADI_SPORT_I2S_MODE, sport_handlerRx,(uint32_t)(SPORT_MEM_SIZE),&hDeviceRx)


adi_sport_ConfigClock(hDeviceRx,0,false ,true,false)

adi_sport_ConfigFrameSync(hDeviceRx,0,false,false ,false,false,false,false)


uint8_t nBufferRx0[SIZE_OF_RX_BUFFER];


adi_sport_RegisterCallback(hDeviceRx,SPORTCallbackRx,NULL)  //


As you can see i made all config functions. 

BUT now call back function is called only once, when i need it to be called every time when i get data, HOW to do that correctly?

Than how to configure buffers and DATA types to get data correctly, AND how to read data from that buffers when i get to callback function?

P.S. working with BF706 EZ-KIT board. Code written in CCES.

Best regards


  • Hello Roman,

    Apologies. We had missed out this thread while tracking in our community.

    We understand that you are trying to receive 24-bit I2S data from the CODEC. In your code, you are configuring the SPORT data length as 3. Please note that the 'nWordLength' parameter in the adi_sport_ConfigData() API will configure the word size of the SPORT data (SLEN). For I2S mode, SPORT Word Length should be 5 to 32. In order to receive 24-bit data, you can set the data length as '23'.

    The reason behind the callback function called only once is you are submitting the buffer only once. By default the DMA will be configured in Stop mode. So you have to re-submit the buffer again to receive the data continuously.

    Also you can't submit multiple buffers at a time. The low level drivers do not maintain read or write buffer queues. They support only a ping pong buffer scheme that allows the application to have only one or two outstanding transactions at a time.

    To use the low level drivers in non-blocking mode and to stream data to or from the driver, an application must allocate two buffers and then proceed to use them in the ping pong manner.

    The callback function will return the processed buffer address in the 'pArg' argument. You can read the received data using this address.

    You can refer the 'AudioFilter_Callback_BF706Mini' example from the ADSP-BF706 BSP. In this example, two SPORT receive buffers (ping/pong) and two SPORT transmit buffers (ping/pong) are used to transfer the audio data. When the audio Rx buffer is full the Rx callback is executed. The received audio buffer is processed using the AudioFilter() function.

    ADSP-BF706 Board Support Package (BSP) can be download from the below link:

    After installing ADSP-BF706 BSP, you can find the example in the below installation path.
    C:\Analog Devices\ADSP-BF706_EZ-KIT_Mini-Rel1.1.0\BF706_EZ-Kit_MINI\Blackfin\Examples\AudioFilter_Callback_BF706Mini

    Santha kumari.K