AnsweredAssumed Answered

What might cause iio_buffer_first() to return (nil)?

Question asked by SMiles on Jul 21, 2015
Latest reply on Jul 22, 2015 by SMiles

I have two fmcomms5 set-ups and wrote programs to transmit and receive data on one of them. It works without issue on the board I wrote the code on, but copying the code to the second board and compiling resulted in a fault. For some reason, the line


assert(ctx = iio_create_local_context() && "No context found");

resulted in ctx = (nil). Replacing  assert(...) with the code below allowed the program to progress.

ctx = iio_create_local_context()

if(!ctx) {fprintf(stderr,"No context found");}


However, it still segfaults later in the program, when iio_buffer_refill is called. Checking my variables showed iio_buffer_first() and iio_buffer_start() returning (nil). Attached is a capture of the code where I create the iio_buffer and check the relevant variable values. The table lists the printed values for both system A and system B, given that the code was written on and works on system A. Any ideas why this is happening? Seems odd to me that things would work differently since both baseboards are the same.