Post Go back to editing

ZCU102+AD9082 Matlab Communication Toolbox Support - Hardware Setup Issue

I am trying to use Matlab to stream data for ZCU102+AD9082: https://wiki.analog.com/resources/tools-software/hsx-toolbox  Matlab version 2020.b, zcu102 rev1.1, AD9082.

After installing the "Communications Toolbox Support Package for Xilinx Zynq-Based Radio", The hardware setup pops up to let me do some configurations, write the SD card, and boot the board. In the "Verify Radio Connection" section, the "Test data path between host and RF card" didn't pass with error msg: Error receiving data from the RF card. The Done LED and DS44 LED on zcu102 are on and normal, But the HMC_STATUS LED on the AD9082 board is on and RED. It is similar to last week when I was trying to set up the Linux image but the device tree/HDFs are from AD9081 instead of AD9082: https://ez.analog.com/fpga/f/q-a/547029/ad9082-zcu102-hmc_status-red-led-is-on/424651#424651

I guess there is a mismatch between the hardware data lanes and the device tree/HDF. 

Is there any working solution for using matlab with ZCU102+AD9082?

Thanks,

Jiachen

Top Replies

Parents
  • In the Matlab, I am trying to get a frame of data: (I am referring to this example code: github.com/.../ad9081PFIR.m)

    uri = 'ip:169.254.145.15';
    %% RX
    rx = adi.AD9081.Rx();
    rx.uri = uri;
    rx.EnabledChannels = 1;
    rx.SamplesPerFrame = 32768;
    data = rx();

    But got errors:

    Error using matlabshared.libiio.base/cstatus
    Channel: voltage2_i not found
    
    Error in adi.common.Attribute/setAttributeLongLong (line 13)
                cstatus(obj,status,['Channel: ' id ' not found']);
    
    Error in adi.AD9081.Base/CheckAndUpdateHW (line 75)
                        obj.setAttributeLongLong(id,attr,value(k),output, tol, phy);
    
    Error in adi.AD9081.Rx/setupInit (line 204)
                obj.CheckAndUpdateHW(obj.ChannelNCOFrequencies,...
    
    Error in adi.common.RxTx/configureChanBuffers (line 219)
                setupInit(obj);
    
    Error in matlabshared.libiio.base/setupImpl
    
    Error in adi.common.RxTx/setupImpl (line 117)
                setupImpl@matlabshared.libiio.base(obj);
    
    Error in Untitled2 (line 7)
    data = rx();

    The sampling is NaN, and it doesn't have a set method:

    >> rx
    
    rx = 
    
      adi.AD9081.Rx with properties:
    
                 SamplingRate: NaN
        ChannelNCOFrequencies: [0 0 0 0]
           MainNCOFrequencies: [0 0 0 0]
             ChannelNCOPhases: [0 0 0 0]
                MainNCOPhases: [0 0 0 0]
                     TestMode: 'off'
                  EnablePFIRs: false
                PFIRFilenames: ''
              SamplesPerFrame: 32768
              EnabledChannels: 1
                          uri: 'ip:169.254.145.15'
    
    >> rx.SamplingRate = 1000
    In class 'adi.AD9081.Rx', no set method is defined for Dependent property 'SamplingRate'.  A Dependent property needs a set method to assign its value.

    Do you know how to resolve it?

  • The sample rate is not a tunable property at runtime. It can only be done through the device tree and will be bound by the available clocks and references.

    https://wiki.analog.com/resources/tools-software/linux-drivers/iio-mxfe/ad9081

    This applies as well: https://wiki.analog.com/resources/eval/user-guides/rf-trx-vcxo-and-profiles

    What device tree are you currently using with AD9082?

    -Travis

  • M=4 in that config so you will only have 4 channels (voltage0_i, voltage0_q, voltage1_i, voltage1_q). The default AD9081 class assumes 8 channels.

    To set it to 4 run you need to update the constructor call to:

    rx = adi.AD9081.Rx('num_data_channels',2); % <- Number is complex channel pairs.

    -Travis

  • Are there any other modifications that need to be made so the AD9081 class can adapt AD9082?

    I changed the number of channels:

    uri = 'ip:169.254.145.15';
    %% RX
    rx = adi.AD9081.Rx('num_data_channels',2); % <- Number is complex channel pairs.
    rx.uri = uri;
    rx.EnabledChannels = [1,2];
    rx.SamplesPerFrame = 32768;
    data = rx();

    But still got Errors:

    >> Untitled2
    Error using matlabshared.libiio.base/cstatus
    Channel: voltage2_i not found
    
    Error in adi.common.Attribute/setAttributeLongLong (line 13)
                cstatus(obj,status,['Channel: ' id ' not found']);
    
    Error in adi.AD9081.Base/CheckAndUpdateHW (line 75)
                        obj.setAttributeLongLong(id,attr,value(k),output, tol, phy);
    
    Error in adi.AD9081.Rx/setupInit (line 204)
                obj.CheckAndUpdateHW(obj.ChannelNCOFrequencies,...
    
    Error in adi.common.RxTx/configureChanBuffers (line 219)
                setupInit(obj);
    
    Error in matlabshared.libiio.base/setupImpl
    
    Error in adi.common.RxTx/setupImpl (line 117)
                setupImpl@matlabshared.libiio.base(obj);
    
    Error in Untitled2 (line 7)
    data = rx();

  • Are there any other modifications that need to be made so the AD9081 class can adapt AD9082?

    No. The number of channels is configurable through the constructor.

    Can you update the number of channelizers as well:

    rx = adi.AD9081.Rx('num_data_channel',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);

    -Travis

  • It works! Thanks.

    So for AD9082, use:
    tx = adi.AD9081.Tx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);
    rx = adi.AD9081.Rx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);

    Jiachen

  • I have another question about changing change the Rx/Tx sample rate. For example, I want to change the Rx sample rate (which is related to the ADC). By default, in the device tree, the ADC freq is 6Ghz with main decimation = 4, channel decimation = 1. Therefore the final sampling rate is 6/(4*1) = 1.5Ghz. If I want to cut the sampling by half (750Mhz), I can change either ADC freq to 3Ghz, or main deviation to 8, or channel decimation to 2, and their final results would be the same. Is it correct? 

    Also, the quick guide mentions there are 100mhz and 122.88mhz VCXO variations. I couldn't find the VXCO value for the AD9082 in the datasheet or on board. Is it 100Mhz?

  • I can change either ADC freq to 3Ghz, or main deviation to 8, or channel decimation to 2, and their final results would be the same. Is it correct? 

    Yes, assuming there are no clock violations.

    Also, the quick guide mentions there are 100mhz and 122.88mhz VCXO variations. I couldn't find the VXCO value for the AD9082 in the datasheet or on board. Is it 100Mhz?

    It will say on the crystal itself on the board. It is also listed in the device tree: https://github.com/analogdevicesinc/linux/blob/d7c0f7cad3280fdcff25a20443ad82487f2d3921/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-ad9082-m4-l8.dts#L55

    -Travis

  • Thanks. I encountered another problem and I didn't find similar posts.

    I am trying to use DMA to stream the data with this segment of the code (mostly from line 109 of https://github.com/analogdevicesinc/HighSpeedConverterToolbox/blob/master/test/AD9081HWTests.m ):


    %% TX
    tx = adi.AD9081.Tx('num_data_channels',2,'num_coarse_attr_channels',2,'num_fine_attr_channels',2);
    tx.uri = uri;
    tx.DataSource = 'DMA';
    tx.NCOEnables = [1 0];
    tx.EnabledChannels = [1];
    tx.MainNCOFrequencies = TX_MainNCOFreq; %[1000e6 1000e6]
    tx.EnableCyclicBuffers = true;
    amplitude = 2^15; frequency = 40e6;
    swv1 = dsp.SineWave(amplitude, frequency);
    swv1.ComplexOutput = false;
    swv1.SamplesPerFrame = 2^20;
    swv1.SampleRate = 1e9;
    y1 = swv1();
    tx(y1);

    But got error:

    >> Untitled2
    Error using matlabshared.libiio.base/cstatusid
    Failed to setup kernel buffers.
    
    Error in matlabshared.libiio.base/configureKernBuffers
    
    Error in matlabshared.libiio.base/setupImpl
    
    Error in adi.common.RxTx/setupImpl (line 117)
                setupImpl@matlabshared.libiio.base(obj);
    
    Error in adi.common.Tx/setupImpl (line 23)
                setupImpl@adi.common.RxTx(obj);
    
    Error in Untitled2 (line 22)
    tx(y1);

    I am using Matlab 2020b with Communication toolbox 20.2.3 and HighSpeedConverter Toolbox 20.2.1.

    Jiachen

  • The transmit buffer is likely too large. Due to the speeds of AD9081/2 there is a FIFO in between the DMA and JESD interface which is smaller than the standard DMA but a lot faster.

    I think you are limited to 2^12 samples per channel (or maybe total).

    -Travis

  • Are "DMA" in the Matlab obj.DataSource and "DAC Buffer output" in the IIO Oscilloscope GUI the same thing?

  • They use the same (or similar) underlying libiio calls.

    -Travis

Reply Children