Unable to Create buffer on ad9361 LTE10

Hello!

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 adi_update_tools.sh and adi_update_boot.sh that came with the Linux distro (although the adi_update_boot.sh was done manually) as unable to create IIO buffer  #31 suggests.

What could be causing the error?

Thanks in advance!

  • +1
    •  Analog Employees 
    on Jul 19, 2021 10:55 PM

    The old libiio-matlab interface has been deprecated and has been replaced by Transceiver Toolbox: https://wiki.analog.com/resources/tools-software/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: https://github.com/analogdevicesinc/MathWorks_tools/blob/master/hil_models/legacy/LTE_MATLAB/ad9361_LTE.m#L50

    -Travis

  • 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

  • 0
    •  Analog Employees 
    on Jul 20, 2021 8:40 PM in reply to leoitt
    the graphs no longer show a correct value

    What do you mean?

    -Travis

  • 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.

    -PDSCHEVM.m

    1)

    original code:

    samplesPerSubframe = dims.SamplingRate/1000; 

    Modify to:

    samplesPerSubframe = dims.SamplingRate/500;

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

    2)

    original code:

    nFrames = floor(nSubframes/10);

    Modify to:

    nFrames = floor(nSubframes/5); 

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

    3)

    original code:

    if (mod(i, 10)==9 || (nFrames==0 && i==nSubframes-1))
    if (nFrames==0)
    sfrange = 1:nSubframes;
    nFrame = 1;
    else
    sfrange = i-8:i+1;
    nFrame = floor((i+1)/10);
    end
    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;
    else
    sfrange = i-3:i+1;
    nFrame = floor((i+1)/5);
    end
    frameLowEVM = lteEVM(cat(1, evm(1, i-2:i).EV));
    frameHighEVM = lteEVM(cat(1, evm(2, i-2:i).EV));

    4)

    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);