Post Go back to editing

Cannot initialize EVAL-AD7606B-FMCZ (no-OS project)

Category: Software
Product Number: EVAL-AD7606B-FMCZ, AD7606B

The basic_example.c in no-OS project
github.com/.../src
returns the following message through serial terminal.

AD7606X Reference Design - Parallel interface.
Initializing device AD7606B, num-channels 8 SDI lines 4
Notice: Parallel mode enabled, forcing SW mode
ad7606: device id mismatch, expected 0x01, got 0x00
ad7606 initialization failed
ERR: ../ad7606x-fmc/src/basic_example.c:78:main(): Error initializing.

In my analysis, the if block in ad7606.c generates an error.

if (no_os_field_get(AD7606_ID_DEVICE_ID_MSK, reg) != id) {
printf("ad7606: device id mismatch, expected 0x%.2x, got 0x%.2x\n",
id,
(int)no_os_field_get(AD7606_ID_DEVICE_ID_MSK, reg));
ret = -ENODEV;
goto error;
}

I am a bigginer of programming and FPGA.
Please teach me how to fix it.


[Environment]
github.com/.../hdl.git
github.com/.../no-OS
Vivado/Vitis 2023.2 on Ubuntu 22.04
EVAL-AD7606B-FMCZ on ZedBoard

  • Hi,

    Can you double check that you selected the desired interface in hw, hdl and no-OS?
    For hdl check: AD7606X HDL Reference Design [Analog Devices Wiki]
    For HW look at the user guide section(JP5) EVAL-AD7606B-FMCZ Evaluation Board | Analog Devices

    Andrei

  • Thank you for your advice.
    I have checked hw, hdl, and no-OS.
    By switching on S1 (all three switches) on EVAL-AD7606B and modifying device_id and dout_format in common_data.c as follows, initialization was successful.

    struct ad7606_init_param ad7606x_init_param_parallel = {
    .axi_init = &ad7606x_axi_init_param,
    .gpio_reset = &ad7606x_gpio_reset,
    .gpio_convst = NULL, // Driven by HDL
    .gpio_busy = NULL, // Driver by HDL
    .gpio_stby_n = &ad7606x_gpio_stby,
    .gpio_range = &ad7606x_gpio_range,
    .gpio_os0 = &ad7606x_gpio_os0,
    .gpio_os1 = &ad7606x_gpio_os1,
    .gpio_os2 = &ad7606x_gpio_os2,
    .gpio_par_ser = &ad7606x_gpio_ser_par,
    .device_id = ID_AD7606B,
    .oversampling = {
    },
    .sw_mode = true,
    .parallel_interface = true,
    .config = {
    .dout_format = AD7606_4_DOUT,
    },
    .digital_diag_enable = { // CRC checks
    },
    .offset_ch = {
    },
    .phase_ch = {
    },
    .gain_ch = {
    },
    .range_ch = {
    { -5000, 5000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -10000, 10000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -5000, 5000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -10000, 10000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -5000, 5000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -10000, 10000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -5000, 5000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    { -10000, 10000, AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR },
    }
    };

    However, a new error has arisen.

    -1ERR: ../ad7606x-fmc/src/basic_example.c:92:main(): Error getting samples.

    This error seems to be arised in "transferring data using DMA."
    Should I further modify common_data.c or other files?
    Can you give me advice?

  • Hi,

    I would look at that line:
    no-OS/projects/ad7606x-fmc/src/basic_example.c at main · analogdevicesinc/no-OS
    Firs, maybe comment it. Then see why does it fail, probably a bad device setting. Not sure that this code was tested on for all supported devices.
    From the name basic_example, I presume not.

    Andrei

  • I stopped testing in parallel mode for the time being, and tested in serial mode.
    The serial mode was successful with the modification of common_data.c described above.
    The make option for HDL was "INTF=1 NUM_OF_SDI=1."
    Thank you.

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.