AnsweredAssumed Answered

error creating iio buffer with multiple rx channels using FMCOMMS5

Question asked by mredfield on Jul 18, 2016
Latest reply on Jul 19, 2016 by mredfield


I'm trying to use libiio on a ZC702 with an FMCOMMS5 board to sample different frequencies simultaneously. My plan is to set up ad9361-PHY for one band and ad9361-PHY-B for the other band in a similar way to the FMCOMMS2 IIO streaming example. Both PHYs have the same sample rate and bandwidth.

 

All of my setup seems to work, but when I try to create an iio buffer I receive the error: "Could not create RX buffer: Device or resource busy". What am I doing wrong here?

 

My code is structured as follows:

printf("* Acquiring IIO context\n");

assert((ctx = iio_create_default_context()) && "No context");

assert(iio_context_get_devices_count(ctx) > 0 && "No devices");




printf("* Acquiring AD9361 streaming devices\n");

assert(get_ad9361_stream_dev(ctx, RX, &rx_A, 1) && "No rx A dev found");

assert(get_ad9361_stream_dev(ctx, RX, &rx_B, 0) && "No rx B dev found");




printf("* Configuring AD9361 A for streaming\n");

assert(cfg_ad9361_streaming_ch(ctx, &rxcfg_A, RX, 0, 1) && "RX port 0 not found on dev A");

printf("* Configuring AD9361 B for streaming\n");

assert(cfg_ad9361_streaming_ch(ctx, &rxcfg_B, RX, 0, 0) && "RX port 0 not found on dev B");




printf("* Initializing AD9361 A IIO streaming receive\n");

assert(get_ad9361_stream_ch(ctx, RX, rx_A, 0, &rx0_A_i) && "RX chan i not found on dev A");

assert(get_ad9361_stream_ch(ctx, RX, rx_A, 1, &rx0_A_q) && "RX chan q not found on dev A");

printf("* Initializing AD9361 B IIO streaming receive\n");

// NOTE: rx_B is slaved to rx_A, so we using rx_As upper channels

assert(get_ad9361_stream_ch(ctx, RX, rx_A, 4, &rx0_B_i) && "RX chan i not found on dev B");

assert(get_ad9361_stream_ch(ctx, RX, rx_A, 5, &rx0_B_q) && "RX chan q not found on dev B");




printf("* Enabling IIO A streaming\n");

iio_channel_enable(rx0_A_i);

iio_channel_enable(rx0_A_q);

printf("* Enabling IIO B streaming\n");

iio_channel_enable(rx0_B_i);

iio_channel_enable(rx0_B_q);



printf("* Creating non-cyclic IIO buffers with 1 MiS\n");

rxbuf_A = iio_device_create_buffer(rx_A, 1024*1024, false);

if (!rxbuf_A) {


perror("Could not create RX buffer for dev A");


shutdown();

}

Outcomes