Post Go back to editing

Unable to Create buffer on ad9361 LTE10


I'm currently trying to connect from MATLAB on Windows to a Linux device using libiio. I'm running the examples presented in the analog devices wiki, more specifically the LTE Transmitter and Receiver Example.

The example works on the modes LTE1.4, LTE3 and LTE5 but when I try to run LTE10 the MATLAB program crashes with an error. In the error details it mentions something about iio_buffer_refill.

Meanwhile on Linux I get the following error on iiod Unable to create buffer when I run the MATLAB program.

I've used the ARRadio ad9361 with two different FPGAs: SoCKit with Cyclone 5 and also DE10-Standard with Cyclone 5 and I get the same error on both devices when operating on LTE10.

I'm using MATLAB 2017b.

So far I've tried the following:

  1. Switching to the MATLAB versions.
  2. Switching the libiio versions on both Windows and Linux.
  3. Running the and that came with the Linux distro (although the was done manually) as unable to create IIO buffer  #31 suggests.

What could be causing the error?

Thanks in advance!

  • The old libiio-matlab interface has been deprecated and has been replaced by Transceiver Toolbox:

    When switching through the configurations the data vector change in size which likely means you are exceed the max buffer size on your board. You can try reducing the number of subframes:


  • Thank you very much; reducing the number of subframes is the solution, but where else should I update the code because, in the middle of the run, the graphs no longer show a correct value; thank you very much in advance again

  • the graphs no longer show a correct value

    What do you mean?


  • When I modify the number of subframes, it seems that it affects the code in the processing of the received data; it seems that I have to change the code in another part as well, the spectrum graph looks good, but the constellation and EVM graph, from of a certain number of subframes no longer receives the signal well

    For example, I change 10 subframes per frame for 5 subframes for frame

    rmc.TotSubframes = txsim.TotFrames*5; % 10 subframes per frame

    And the command window shows 

    Low edge EVM, subframe 0: 2.925%
    High edge EVM, subframe 0: 2.935%
    Low edge EVM, subframe 1: 2.934%
    High edge EVM, subframe 1: 2.941%
    Low edge EVM, subframe 2: 3.111%
    High edge EVM, subframe 2: 3.127%
    Low edge EVM, subframe 3: 3.032%
    High edge EVM, subframe 3: 3.006%
    CRC failed on decoded data. Subframe 4 not taken for EVM.
    Low edge EVM, subframe 4: 127.471%

    So I think that I need to modify the code in another part as well.

    Thanks in advance!

  • I did this, and it seems fixed

    For 5 subrames for frame (rmc.TotSubframes = txsim.TotFrames*5)

    so subframes=5.



    original code:

    samplesPerSubframe = dims.SamplingRate/1000; 

    Modify to:

    samplesPerSubframe = dims.SamplingRate/500;

    equivalent -> samplesPerSubframe = dims.SamplingRate/subframes*100


    original code:

    nFrames = floor(nSubframes/10);

    Modify to:

    nFrames = floor(nSubframes/5); 

    equivalent -> nFrames = floor(nSubframes/subrames); 


    original code:

    if (mod(i, 10)==9 || (nFrames==0 && i==nSubframes-1))
    if (nFrames==0)
    sfrange = 1:nSubframes;
    nFrame = 1;
    sfrange = i-8:i+1;
    nFrame = floor((i+1)/10);
    frameLowEVM = lteEVM(cat(1, evm(1, i-7:i).EV));
    frameHighEVM = lteEVM(cat(1, evm(2, i-7:i).EV));

    Modify to:

    if (mod(i, 5)==4 || (nFrames==0 && i==nSubframes-1))
    if (nFrames==0)
    sfrange = 1:nSubframes;
    nFrame = 1;
    sfrange = i-3:i+1;
    nFrame = floor((i+1)/5);
    frameLowEVM = lteEVM(cat(1, evm(1, i-2:i).EV));
    frameHighEVM = lteEVM(cat(1, evm(2, i-2:i).EV));


    original code:

    enb.NSubframe = mod(enb.NSubframe+1, 10);

    Modify to:

    enb.NSubframe = mod(enb.NSubframe+1, 5);

    equivalent -> enb.NSubframe = mod(enb.NSubframe+1, subframes);