Stream data into/out of MATLAB

Hi ,

 

I want to Stream data into/out of MATLAB

With your tools so I started with the following link:

https://wiki.analog.com/resources/tools-software/transceiver-toolbox

 

I then performed the following steps:

I use windows.

And I installed the

MATLAB R2020a

Xilinx Vivado 2018.2

AnalogDevicesTransceiverToolbox_v20.1.1.mltbx

 

I installed Libiio Installers

 

Now I'm trying to figure out what I should have in SD CARD if at all?

 

 

I am using ZC706 + AD9361

 

Thanks for your help

Parents
  • 0
    •  Analog Employees 
    on Apr 1, 2021 1:46 PM

    Please look at the instructions on this page - https://wiki.analog.com/resources/tools-software/linux-software/zynq_images. The image you are looking for needs to be copied to the base directory from the subdirectory as explained in "Preparing the image" section. Let us know if you have questions.

    - Srikanth

  • Hi Srikanth,

    i followed the instructions in the link, write the file to MY SD card.
    Additionally copied the image  to the base directory from the subdirectory

    And I managed to run the example at the following link:

    https://github.com/analogdevicesinc/TransceiverToolbox/tree/master/trx_examples/streaming/ad936x

    DMA_EXAMPLE.m  

    I am currently interested in an example of targeting from your site.
    What example can you recommend me to use if I use the VIVADO 2019.1 version and the ADI versions I mentioned above?
    And according to what documentation to focus on in order to get guidance ??

    please advise

    thanks

    ron

  • 0
    •  Analog Employees 
    on Apr 5, 2021 9:59 PM in reply to ron1

    Please take a look at this targeting example. https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/matlab_bsp_modem. You can find Mathworks' targeting examples here - https://www.mathworks.com/help/supportpkg/xilinxzynqbasedradio/examples.html?category=hardware-software-co-design&exampleproduct=all&s_tid=CRUX_lftnav. But, you would need to install Communications Toolbox Support Package for Xilinx Zynq-Based Radio - www.mathworks.com/.../index.html

    Currently, we support Vivado 2018.3. A future release will support 2019.1 

  • Hi

    1. So can I use MATLAB R2020a ,Xilinx Vivado 2018.2 ,AnalogDevicesTransceiverToolbox_v20.1.1.mltbx?

     2. I used this example https://wiki.analog.com/resources/eval/user-guides/picozed_sdr/tutorials/adsb

     

    And When I got to step :

    Step 5: Copy and paste the generated BOOT.BIN onto SD card

    Use the latest image from ADI. Replace the BOOT.BIN on SD card with the newly generated BOOT.BIN from HDL Workflow Advisor.

     

    I see in UART these messages so I can not connect using Cygwin to proceed.

     

    CPU: 1 PID: 1 Comm: init Not tainted 4.19.0-ga6ef26d #1104

    Hardware name: Xilinx Zynq Platform

    [<c010fa50>] (unwind_backtrace) from [<c010bd5c>] (show_stack+0x10/0x14)

    [<c010bd5c>] (show_stack) from [<c08f666c>] (dump_stack+0x8c/0xa0)

    [<c08f666c>] (dump_stack) from [<c011e33c>] (panic+0xf0/0x25c)

    [<c011e33c>] (panic) from [<c012148c>] (do_exit+0xa5c/0xa74)

    [<c012148c>] (do_exit) from [<c01221a0>] (do_group_exit+0x3c/0xbc)

    [<c01221a0>] (do_group_exit) from [<c012cbec>] (get_signal+0x144/0x5fc)

    [<c012cbec>] (get_signal) from [<c010b3bc>] (do_signal+0xcc/0x4e0)

    [<c010b3bc>] (do_signal) from [<c010b998>] (do_work_pending+0xb8/0xdc)

    [<c010b998>] (do_work_pending) from [<c010106c>] (slow_work_pending+0xc/0x20)

    Exception stack(0xef065fb0 to 0xef065ff8)

    5fa0:                                     00000000 00000000 00000000 00000000

    5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

    5fe0: 00000000 befe4f10 00000000 b6ef3a30 00000010 ffffffff

    CPU0: stopping

    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0-ga6ef26d #1104

    Hardware name: Xilinx Zynq Platform

    [<c010fa50>] (unwind_backtrace) from [<c010bd5c>] (show_stack+0x10/0x14)

    [<c010bd5c>] (show_stack) from [<c08f666c>] (dump_stack+0x8c/0xa0)

    [<c08f666c>] (dump_stack) from [<c010e034>] (ipi_cpu_stop+0x64/0x74)

    [<c010e034>] (ipi_cpu_stop) from [<c010e78c>] (handle_IPI+0x78/0x88)

    [<c010e78c>] (handle_IPI) from [<c0337814>] (gic_handle_irq+0x8c/0x90)

    [<c0337814>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0xa8)

    Exception stack(0xc1301ef0 to 0xc1301f38)

    1ee0:                                     00000000 00000001 2e589000 ef7d1740

    1f00: ffffe000 c1303c70 00000001 00000001 00000001 ef7d0a98 12142772 121016ab

    1f20: 0000000b c1301f40 c05c0460 c05c0464 00000113 ffffffff

    [<c0101a0c>] (__irq_svc) from [<c05c0464>] (cpuidle_enter_state+0x8c/0x300)

    [<c05c0464>] (cpuidle_enter_state) from [<c01465cc>] (do_idle+0x1ec/0x238)

    [<c01465cc>] (do_idle) from [<c01468e8>] (cpu_startup_entry+0x18/0x20)

    [<c01468e8>] (cpu_startup_entry) from [<c1200cd4>] (start_kernel+0x3e4/0x404)

    ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007

     

    Would appreciate help

    Thanks

    Ron

  • 0
    •  Analog Employees 
    on Apr 6, 2021 11:07 PM in reply to ron1

    1. Yes. We recommend most people start with the Zynq SDR support package. Its required to be installed for the Transceiver Toolbox as well.

    2. This kinda looks like you have a corrupted kernel. If you switch back to the old BOOT.BIN does it boot correctly?

    -Travis

Reply Children
  • Hi Travis 

    thanks for the response 

    yes, it boot correctly

    thanks

    Ron

  • Hi Travis ,

    Do you have any suggestions for a solution?

    Maybe something to do with incompatible versions?
    Maybe you want me to try another example?

  • 0
    •  Analog Employees 
    on Apr 9, 2021 4:51 PM in reply to ron1

    Can you export the HDL Workflow Advisor configuration as a script and post it here?

    -Travis

  • yes

    %--------------------------------------------------------------------------
    % HDL Workflow Script
    % Generated with MATLAB 9.8 (R2020a) at 13:16:17 on 10/04/2021
    % This script was generated using the following parameter values:
    % Filename : 'C:\tr_toolbox\hdlworkflow.m'
    % Overwrite : true
    % Comments : true
    % Headers : true
    % DUT : 'ModeS_ADI_Codegen/Detector'
    % To view changes after modifying the workflow, run the following command:
    % >> hWC.export('DUT','ModeS_ADI_Codegen/Detector');
    %--------------------------------------------------------------------------

    %% Load the Model
    load_system('ModeS_ADI_Codegen');

    %% Restore the Model to default HDL parameters
    %hdlrestoreparams('ModeS_ADI_Codegen/Detector');

    %% Model HDL Parameters
    %% Set Model 'ModeS_ADI_Codegen' HDL parameters
    hdlset_param('ModeS_ADI_Codegen', 'Backannotation', 'on');
    hdlset_param('ModeS_ADI_Codegen', 'CodeGenerationOutput', 'GenerateHDLCodeAndDisplayGeneratedModel');
    hdlset_param('ModeS_ADI_Codegen', 'HDLSubsystem', 'ModeS_ADI_Codegen/Detector');
    hdlset_param('ModeS_ADI_Codegen', 'OptimizationReport', 'on');
    hdlset_param('ModeS_ADI_Codegen', 'ReferenceDesign', 'FMCOMMS2/3 ZC706 (RX)');
    hdlset_param('ModeS_ADI_Codegen', 'ResourceReport', 'on');
    hdlset_param('ModeS_ADI_Codegen', 'SynthesisTool', 'Xilinx Vivado');
    hdlset_param('ModeS_ADI_Codegen', 'SynthesisToolChipFamily', 'Zynq');
    hdlset_param('ModeS_ADI_Codegen', 'SynthesisToolDeviceName', 'xc7z045');
    hdlset_param('ModeS_ADI_Codegen', 'SynthesisToolPackageName', 'ffg900');
    hdlset_param('ModeS_ADI_Codegen', 'SynthesisToolSpeedValue', '-2');
    hdlset_param('ModeS_ADI_Codegen', 'TargetDirectory', 'C:\tr_toolbox\hdl_prj\hdlsrc');
    hdlset_param('ModeS_ADI_Codegen', 'TargetLanguage', 'Verilog');
    hdlset_param('ModeS_ADI_Codegen', 'TargetPlatform', 'AnalogDevices FMCOMMS2/3 ZC706');
    hdlset_param('ModeS_ADI_Codegen', 'Traceability', 'on');
    hdlset_param('ModeS_ADI_Codegen', 'Workflow', 'IP Core Generation');

    % Set SubSystem HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector', 'AXI4SlaveIDWidth', '12');
    hdlset_param('ModeS_ADI_Codegen/Detector', 'ProcessorFPGASynchronization', 'Free running');

    % Set Inport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/I_In', 'IOInterface', 'AD9361 ADC Data I0 [0:15]');
    hdlset_param('ModeS_ADI_Codegen/Detector/I_In', 'IOInterfaceMapping', '[0:15]');

    % Set Inport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/Q_In', 'IOInterface', 'AD9361 ADC Data Q0 [0:15]');
    hdlset_param('ModeS_ADI_Codegen/Detector/Q_In', 'IOInterfaceMapping', '[0:15]');

    % Set S-Function HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/CalcNF/NoiseFloor', 'AddPipelineRegisters', 'on');
    hdlset_param('ModeS_ADI_Codegen/Detector/CalcNF/NoiseFloor', 'MultiplierOutputPipeline', 1);

    % Set S-Function HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/CalcSyncCorr/SyncCorr', 'AddPipelineRegisters', 'on');
    hdlset_param('ModeS_ADI_Codegen/Detector/CalcSyncCorr/SyncCorr', 'MultiplierOutputPipeline', 1);

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/reset', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/reset', 'IOInterfaceMapping', 'x"100"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/bit_process', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/bit_process', 'IOInterfaceMapping', 'x"104"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/empty_reg', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/empty_reg', 'IOInterfaceMapping', 'x"108"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/bit_clk', 'IOInterface', 'IP Data Valid OUT');
    hdlset_param('ModeS_ADI_Codegen/Detector/bit_clk', 'IOInterfaceMapping', '[0]');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/bits', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/bits', 'IOInterfaceMapping', 'x"10C"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/crc', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/crc', 'IOInterfaceMapping', 'x"110"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/noise_floor', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/noise_floor', 'IOInterfaceMapping', 'x"114"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/sync_corr', 'IOInterface', 'AXI4');
    hdlset_param('ModeS_ADI_Codegen/Detector/sync_corr', 'IOInterfaceMapping', 'x"118"');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/data', 'IOInterface', 'IP Data 0 OUT [0:15]');
    hdlset_param('ModeS_ADI_Codegen/Detector/data', 'IOInterfaceMapping', '[0:15]');

    % Set Outport HDL parameters
    hdlset_param('ModeS_ADI_Codegen/Detector/frame_valid', 'IOInterface', 'IP Data 1 OUT [0:15]');
    hdlset_param('ModeS_ADI_Codegen/Detector/frame_valid', 'IOInterfaceMapping', '[0:15]');


    %% Workflow Configuration Settings
    % Construct the Workflow Configuration Object with default settings
    hWC = hdlcoder.WorkflowConfig('SynthesisTool','Xilinx Vivado','TargetWorkflow','IP Core Generation');

    % Specify the top level project directory
    hWC.ProjectFolder = 'C:\tr_toolbox\hdl_prj';
    hWC.ReferenceDesignToolVersion = '2018.2';
    hWC.IgnoreToolVersionMismatch = false;

    % Set Workflow tasks to run
    hWC.RunTaskGenerateRTLCodeAndIPCore = true;
    hWC.RunTaskCreateProject = true;
    hWC.RunTaskGenerateSoftwareInterfaceModel = true;
    hWC.RunTaskBuildFPGABitstream = true;
    hWC.RunTaskProgramTargetDevice = false;

    % Set properties related to 'RunTaskGenerateRTLCodeAndIPCore' Task
    hWC.IPCoreRepository = '';
    hWC.GenerateIPCoreReport = true;

    % Set properties related to 'RunTaskCreateProject' Task
    hWC.Objective = hdlcoder.Objective.None;
    hWC.AdditionalProjectCreationTclFiles = '';
    hWC.EnableIPCaching = false;

    % Set properties related to 'RunTaskGenerateSoftwareInterfaceModel' Task
    hWC.OperatingSystem = 'Linux';

    % Set properties related to 'RunTaskBuildFPGABitstream' Task
    hWC.RunExternalBuild = true;
    hWC.TclFileForSynthesisBuild = hdlcoder.BuildOption.Custom;
    hWC.CustomBuildTclFile = 'C:\tr_toolbox\hdl_prj\vivado_ip_prj\projects\scripts\adi_build.tcl';

    % Set properties related to 'RunTaskProgramTargetDevice' Task
    hWC.ProgrammingMethod = hdlcoder.ProgrammingMethod.Download;

    % Validate the Workflow Configuration Object
    hWC.validate;

    %% Run the workflow
    hdlcoder.runWorkflow('ModeS_ADI_Codegen/Detector', hWC);

  • Hi Travis,


    Can I perhaps pass on more information that can help solve my problem?

    Maybe try running on a different example or version?

    thanks

    Ron