AnsweredAssumed Answered

AD9361 TX cyclic buffer error -16

Question asked by nacbapat on May 17, 2017
Latest reply on May 19, 2017 by mhennerich

Hi,

I'm trying to create a cyclic TX buffer with the following command:

 

 

*************************************************************************************************************************************

    txbuf = iio_device_create_buffer(tx, fft_size, true);
    if (!txbuf) {
        perror("Could not create TX buffer");
        shutdown();
    }

*************************************************************************************************************************************

 

And filling up the buffer like this:

where cosine_stored is an array of cosine_values of a random frequency which i wish to transmit.

 

 

 

*************************************************************************************************************************************

            // WRITE: Get pointers to TX buf and write IQ to TX buf port 0
            p_inc = iio_buffer_step(txbuf);
            p_end = iio_buffer_end(txbuf);
            int iteratorelement =0;
            for (p_dat = iio_buffer_first(txbuf, tx0_i); p_dat < p_end; p_dat += p_inc)
            {
                ((int16_t*)p_dat)[0] = cosine_stored[i] << 4; // Real (I)
                ((int16_t*)p_dat)[1] = 0 << 4; // Imag (Q)

 

                iteratorelement ++;
            }

*************************************************************************************************************************************

Without the cyclic buffer the programs works OK but transmits the array once and stops. And hence i wish to try the cyclic buffer version.

 

i get an error :

 

Error pushing buffer -16.

 

What shall i do ?

 

Mit freundlichen Grüßen,

Nachiket Bapat

Outcomes