Post Go back to editing

Command Line Interface not giving feedback

Hi,

I'm working with the AD7134 trying to get the Zedboard example working. 

I've tried uploading to the board from CMD and Vivado - both successfully upload, but have this same issue.

I'm trying to use the spi.c commands to read out info to verify functionality:

You can see that it accepts spi_init and write_and_read as valid commands and not xil_spi_init or jibberish.

I'm just not getting anything back - so I can't even tell if this is a hw connection issue, I'm using the commands incorrectly, or if something didn't build correctly. I do get the below two error and warning which may be causing the issue. I'm just not sure how to resolve them.

Thank you for any assistance.

  • Hi,

    Please make sure your no-Os repository is up to date. It looks like the run command is building the project instead of uploading the elf file.

    Sergiu

  • Thanks.  My repository is up to date since I just started over from scratch.

    Please answer these questions.

    1) Do you have these boards (AD7134 and zedboard) to try this code?

    2) Can you confirm that my make output is as expected, including missing files and errors? (see below)

    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>make clean
    [00:00:00] [Delete] ad713x.o iio_ad713x.o iio_dual_ad713x.o axi_dmac.o spi_engine.o gpio.o axi_io.o delay.o xilinx_gpio.o xilinx_spi.o spi.o ad713x_fmc.o util.o ad713x_fmcz.elf
    The system cannot find the file specified.
    make: [../../tools/scripts/generic.mk:358: clean] Error 1 (ignored)

    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>make
    [00:00:00] Building for xilinx
    [00:00:00] Evaluating hardware: system_top.xsa
    [00:00:00] Creating and configuring the IDE project
    arm-none-eabi-ar: creating ../../../lib/libxil.a
    In file included from usleep.c:34:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xil_sleeptimer.c:32:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xtime_l.c:27:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from sleep.c:31:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from main.c:115:
    zynq_fsbl_bsp/ps7_cortexa9_0/include/xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from pcap.c:78:
    zynq_fsbl_bsp/ps7_cortexa9_0/include/xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    arm-none-eabi-ar: creating ../../../lib/libxil.a
    In file included from usleep.c:34:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xil_sleeptimer.c:32:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xtime_l.c:27:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from sleep.c:31:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    [00:00:00]  Linking srcs to created project
    The system cannot find the file specified.
    The system cannot find the file specified.
    The system cannot find the file specified.
    make[1]: [../../tools/scripts/generic.mk:339: update_srcs] Error 2 (ignored)
    [00:00:00] [CC] ad713x.c
    [00:00:00] [CC] iio_ad713x.c
    [00:00:00] [CC] iio_dual_ad713x.c
    [00:00:00] [CC] axi_dmac.c
    [00:00:00] [CC] spi_engine.c
    [00:00:00] [CC] gpio.c
    [00:00:00] [CC] axi_io.c
    [00:00:00] [CC] delay.c
    [00:00:00] [CC] xilinx_gpio.c
    [00:00:00] [CC] xilinx_spi.c
    [00:00:00] [CC] spi.c
    [00:00:00] [CC] ad713x_fmc.c
    [00:00:00] [CC] util.c
    [00:00:00] [LD] ad713x.o iio_ad713x.o iio_dual_ad713x.o axi_dmac.o spi_engine.o gpio.o axi_io.o delay.o xilinx_gpio.o xilinx_spi.o spi.o ad713x_fmc.o util.o
    make[2]: Nothing to be done for 'post_build'.
    [00:00:00] Done (build/ad713x_fmcz.elf)

  • Hi Steve,


    As I see in the code in the master version of the project (https://github.com/analogdevicesinc/no-OS/blob/master/projects/ad713x_fmcz/src/ad713x_fmc.c) you don't need to interact with the code it will just print data, or if you enable TINYIIOD (how to enable tinyiiod) you can connect using IIO Osciloscope.

    My recommendation are:

    Open a windows cmd with administrator privileges in the project folder.

    Run a `make clean_all` in order to start from a clean workspace.

    Then run `make update_srcs` this will just create an sdk project you can edit.

    Run  `make develop` : will open xsdk with the created projects.

    Program the fpga from the sdk.

    Set a breakpoint at main and then debug.

    Are you able to see data from the first printf?

    Regards,

    Mihail

  • Mihail,

    I did as you suggested.  The result is the same.  I get as far as this instruction on line 209 in ad713x_fmc.c, which fails every time.

        ret = ad713x_init(&ad713x_dev_1, &ad713x_init_param_1);

    Here is the output from CMD:

    NOTE that I'm still getting errors during the final link process.  I've asked several times if these errors are expected, but no one has answered this question.

    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>make clean_all
    [00:00:00] [Delete] C:/cygwin64/home/Steve/adi4/no-OS/projects/ad713x_fmcz/build

    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>make update_srcs
    [00:00:00] Evaluating hardware: system_top.xsa
    [00:00:00] Creating and configuring the IDE project
    arm-none-eabi-ar: creating ../../../lib/libxil.a
    In file included from usleep.c:34:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xil_sleeptimer.c:32:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xtime_l.c:27:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from sleep.c:31:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from main.c:115:
    zynq_fsbl_bsp/ps7_cortexa9_0/include/xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from pcap.c:78:
    zynq_fsbl_bsp/ps7_cortexa9_0/include/xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    arm-none-eabi-ar: creating ../../../lib/libxil.a
    In file included from usleep.c:34:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xil_sleeptimer.c:32:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from xtime_l.c:27:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    In file included from sleep.c:31:
    xtime_l.h:65:9: note: #pragma message: For the sleep routines, Global timer is being used
       65 | #pragma message ("For the sleep routines, Global timer is being used")
          |         ^~~~~~~
    [00:00:00]  Linking srcs to created project
    The system cannot find the file specified.
    The system cannot find the file specified.
    The system cannot find the file specified.
    make: [../../tools/scripts/generic.mk:339: update_srcs] Error 2 (ignored)

    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>make develop
    vitis -workspace=C:/cygwin64/home/Steve/adi4/no-OS/projects/ad713x_fmcz/build

    ****** Xilinx Vitis Development Environment
    Vitis v2020.1 (64-bit)
    ****** SW Build 2902540 on Wed May 27 19:55:32 MDT 2020
        ** Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.


    C:\cygwin64\home\Steve\adi4\no-OS\projects\ad713x_fmcz>

  • Yes, the output of the terminal is normal. They are xilinx bsp related warnings.
    Can you step inside the ad713x_init function and see which function fails, there seems to be many thinks that can fail.

  • Yes, it's failing in spi.c on line 57 and returning FAILURE

    int32_t spi_init(struct spi_desc **desc,
             const struct spi_init_param *param)
    {
        if (!param)
            return FAILURE;

        if ((param->platform_ops->init(desc, param)))
            return FAILURE;

        (*desc)->platform_ops = param->platform_ops;

        return SUCCESS;
    }

  • Do you have the same hardware to try this on (AD7134_EVAL and zedboard)?

  • Some of these parameters look suspect.  Can you confirm they are correct?

  • Hi Steve,

    For this platform, the device id and bit order parameters are irrelevant.

    Also 0x989680 in hex is the same as 10 000 000 in decimal which represents the 10mhz sclk speed.

    You could try debugging a bit deeper and go inside the param->platform_ops->init(desc, param) function (that should go to https://github.com/analogdevicesinc/no-OS/blob/master/drivers/axi_core/spi_engine/spi_engine.c#L623 ) and see exactly where the code is failing.

    Sergiu

  • The device_id was causing the failure for both of these commands.  I changed them both to a value of 01 and the init function no longer fails.

    ret = ad713x_init(&ad713x_dev_1, &ad713x_init_param_1);

    ret = ad713x_init(&ad713x_dev_2, &ad713x_init_param_2);

    However, I believe this causes later issues since the first read from spi returns 0x0.  What is the correct device_id to use ?