Post Go back to editing

Issues faced during SPI initialisation of the hmc7044 - after migration of the HDL reference design from VCU (referring to ADI github repo) to ZCU102 MPSoC PL

Category: Software
Product Number: AD9172
Software Version: Vitis 2023.2

I am using the AD9172 FMC evaluation board in order to generate SPOT frequencies ranging from 2 to 3.5 GHz. I have successfully migrated the ADI reference design available for the VCU to a ZCU102 with micro-blaze (PL SIde). I am also able to build the vitis application (2023.2) using ADI's no os guide however during the debug process i am getting the following error:

WARNING : Read/Write check failed (0xFF)
Probed. SPI read support failed
tx adxcvr : OK (7372800 kHz)

The execution is stuck in a while loop and the jesd link does not become active

I have made sure to check all physical constraints related to spi properly wrt to zcu102 and i am also able to observer the spi_mosi, spi_sclk, spi_cs on the pmod header as well as in the iLA.
It looks like there is some issue in the read/response (spi_miso) from the hmc7044.
I have also verified the axi quad spi IP attributes and setting and made sure that the io1_i, io1_o, io0_i, io0_o assignments are proper.
I am using a very low SPI clock of 1.5625 MHz

I can also confirm that there is nothing wrong with the zcu102 carrier board since the zynq PS design for the ad9172 is working perfectly fine.
I am attaching my top.v file below

`timescale 1ns/100ps

module system_top #(
  parameter NUM_LINKS = 2,
  parameter DEVICE_CODE = 0
) (
input                   sys_rst,
input                   USER_SI570_P,
input                   USER_SI570_N,

input                   uart_sin,
output                  uart_sout,

output                  c0_ddr4_act_n,
output      [16:0]      c0_ddr4_adr,
output      [ 1:0]      c0_ddr4_ba,
output      [ 0:0]      c0_ddr4_bg,
output      [ 0:0]      c0_ddr4_ck_c,
output      [ 0:0]      c0_ddr4_ck_t,

//  output                  ddr4_ck_p,
//  output                  ddr4_ck_n,
output      [ 0:0]      c0_ddr4_cke,
output      [ 0:0]      c0_ddr4_cs_n,
inout       [ 1:0]      c0_ddr4_dm_dbi_n,
inout       [15:0]      c0_ddr4_dq,
inout       [ 1:0]      c0_ddr4_dqs_c,
inout       [ 1:0]      c0_ddr4_dqs_t,
output      [ 0:0]      c0_ddr4_odt,
output                  c0_ddr4_reset_n,

//  output                  mdio_mdc,
//  inout                   mdio_mdio,
//  input                   phy_clk_p,
//  input                   phy_clk_n,
//  output                  phy_rst_n,
input                   ETH_0_RXN,
input                   ETH_0_RXP,
output                  ETH_0_TXN,
output                  ETH_0_TXP,
output       [1:0]      SFPx_TX_DISABLE,



inout       [16:0]      gpio_bd,

output                  gpio_1,
output                  gpio_2,
input                   gpio_3,
input                   gpio_4,

//output                  iic_rstn,
inout                   iic_scl,
inout                   iic_sda,

input                   SFP_SI5328_OUT_C_N,
input                   SFP_SI5328_OUT_C_P,

input                   USER_MGT_SI570_CLOCK2_P,
input                   USER_MGT_SI570_CLOCK2_N,

input                   tx_ref_clk_n,
input                   tx_ref_clk_p,

input                   tx_sysref_p,
input                   tx_sysref_n,
input       [ 1:0]      tx_sync_p,
input       [ 1:0]      tx_sync_n,
output      [ 7:0]      tx_data_p,
output      [ 7:0]      tx_data_n,

output                  spi_csn_dac,
output                  spi_csn_clk,
output                  spi_csn_clk2,
input                   spi_miso,
output                  spi_mosi,
output                  spi_clk,
output                  spi_en,
  
output                    PMOD0_0,  
output                    PMOD0_1,  
input                     PMOD0_2, 
output                    PMOD0_3, 

output                    PMOD0_4,  
output                    PMOD0_5,  
input                     PMOD0_6,  
output                    PMOD0_7,  

output                    PMOD1_0,  
output                    PMOD1_1,  
input                     PMOD1_2,  
output                    PMOD1_3,  

output                    PMOD1_4,  
output                    PMOD1_5,  
output                    PMOD1_6,  
output                    PMOD1_7,
  

inout       [ 4:0]      dac_ctrl
);

  // internal signals

  wire    [63:0]  gpio_i;
  wire    [63:0]  gpio_o;
  wire    [63:0]  gpio_t;
  wire    [ 2:0]  spi_csn;
  wire            tx_ref_clk;
  wire            tx_sysref;
  wire    [ 1:0]  tx_sync;
  wire            tx_sysref_loc;
  wire            spi_clk_mon;
  wire            spi_miso_mon;
  wire            spi_mosi_mon;
//  assign iic_rstn = 1'b1;
  // spi
  assign PMOD1_4 = spi_csn[0];
  assign PMOD1_5 = spi_clk_mon;
  assign spi_miso_mon = spi_miso;
  assign PMOD1_6 = spi_miso_mon;
  assign PMOD1_7 = spi_mosi_mon;
  
  assign spi_clk = spi_clk_mon;
//  assign spi_miso = spi_miso_mon;
  assign spi_mosi = spi_mosi_mon;
  // spi_en is active ...
  //   ... high for AD9135-FMC-EBZ, AD9136-FMC-EBZ, AD9144-FMC-EBZ,
  //   ... low for AD9171-FMC-EBZ, AD9172-FMC-EBZ, AD9173-FMC-EBZ
  // If you are planning to build a bitstream for just one of those boards you
  // can hardwire the logic level here.
  //
  assign spi_en = (DEVICE_CODE <= 2);
  assign SFPx_TX_DISABLE = "11";
  //                                        9135/9144/9172    916(1,2,3,4)
  //                                        9135/9144/9172    916(1,2,3,4)
  assign spi_csn_dac  = spi_csn[1];
  assign spi_csn_clk  = spi_csn[0];    //   HMC7044          AD9508
  assign spi_csn_clk2 = spi_csn[2];    //   NC               ADF4355

  /* JESD204 clocks and control signals */
//  IBUFDS_GTE3 i_ibufds_tx_ref_clk_121 (
//    .CEB (1'd0),
//    .I (USER_MGT_SI570_CLOCK2_P),
//    .IB (USER_MGT_SI570_CLOCK2_N),
//    .O (tx_ref_clk_156),
//    .ODIV2 ());

   IBUFDS_GTE4 #(
      .REFCLK_EN_TX_PATH(1'b0),   // Refer to Transceiver User Guide.
      .REFCLK_HROW_CK_SEL(2'b00), // Refer to Transceiver User Guide.
      .REFCLK_ICNTL_RX(2'b00)     // Refer to Transceiver User Guide.
   )
   IBUFDS_GTE4_inst (
      .O(tx_ref_clk_156),         // 1-bit output: Refer to Transceiver User Guide.
      .ODIV2(), // 1-bit output: Refer to Transceiver User Guide.
      .CEB(1'd0),     // 1-bit input: Refer to Transceiver User Guide.
      .I(tx_ref_clk_p),         // 1-bit input: Refer to Transceiver User Guide.
      .IB(tx_ref_clk_n)        // 1-bit input: Refer to Transceiver User Guide.
   );
   
//      IBUFDS_GTE4 #(
//      .REFCLK_EN_TX_PATH(1'b0),   // Refer to Transceiver User Guide.
//      .REFCLK_HROW_CK_SEL(2'b00), // Refer to Transceiver User Guide.
//      .REFCLK_ICNTL_RX(2'b00)     // Refer to Transceiver User Guide.
//   )
//   IBUFDS_GTE4_inst_1 (
//      .O(mgt_ref_clk),         // 1-bit output: Refer to Transceiver User Guide.
//      .ODIV2(), // 1-bit output: Refer to Transceiver User Guide.
//      .CEB(1'd0),     // 1-bit input: Refer to Transceiver User Guide.
//      .I(SFP_SI5328_OUT_C_P),         // 1-bit input: Refer to Transceiver User Guide.
//      .IB(SFP_SI5328_OUT_C_N)        // 1-bit input: Refer to Transceiver User Guide.
//   );

//  IBUFDS_GTE3 i_ibufds_tx_ref_clk_126 (
//    .CEB (1'd0),
//    .I (tx_ref_clk_126_p),
//    .IB (tx_ref_clk_126_n),
//    .O (tx_ref_clk_126),
//    .ODIV2 ());

  IBUFDS i_ibufds_tx_sysref (
    .I (tx_sysref_p),
    .IB (tx_sysref_n),
    .O (tx_sysref));

  IBUFDS i_ibufds_tx_sync_0 (
    .I (tx_sync_p[0]),
    .IB (tx_sync_n[0]),
    .O (tx_sync[0]));

  IBUFDS i_ibufds_tx_sync_1 (
    .I (tx_sync_p[1]),
    .IB (tx_sync_n[1]),
    .O (tx_sync[1]));

  /* FMC GPIOs */
  ad_iobuf #(
    .DATA_WIDTH(5)
  ) i_iobuf (
    .dio_t (gpio_t[21+:5]),
    .dio_i (gpio_o[21+:5]),
    .dio_o (gpio_i[21+:5]),
    .dio_p ({
      dac_ctrl           /* 25 - 21 */
    }));

  /*
  * Control signals for different FMC boards:
  *
  * dac_ctrl  FMC   9144 like    9162 like       9172 like
  *        0  H13   FMC_TXEN_0   FMC_TXEN_0      FMC_PE_CTRL
  *        1  C10   NC           NC              FMC_TXEN_0
  *        2  C11   NC           NC              FMC_TXEN_1
  *        3  H14   FMC_TXEN_1   NC              NC
  *        4  D15   NC           FMC_HMC849VCTL  NC
  */


  assign dac_fifo_bypass = gpio_o[40];

  /* Board GPIOS. Buttons, LEDs, etc... */
  ad_iobuf #(
    .DATA_WIDTH(17)
  ) i_iobuf_bd (
    .dio_t (gpio_t[0+:17]),
    .dio_i (gpio_o[0+:17]),
    .dio_o (gpio_i[0+:17]),
    .dio_p (gpio_bd));

  assign gpio_i[63:26] = gpio_o[63:26];
  assign gpio_i[20:17] = gpio_o[20:17];



  system_wrapper i_system_wrapper (
    .PS_28V_STS_0(1'b1),
    .PS_5V_LO_STS_0(1'b1),
    .PS_5V_TX_STS_0(1'b1),
    .SYNC_TRG_0(1'b1),
    .ddr4_act_n (c0_ddr4_act_n),
    .ddr4_adr (c0_ddr4_adr),
    .ddr4_ba (c0_ddr4_ba),
    .ddr4_bg (c0_ddr4_bg),
    .ddr4_ck_c (c0_ddr4_ck_c),
    .ddr4_ck_t (c0_ddr4_ck_t),
    .ddr4_cke (c0_ddr4_cke),
//    .ddr4_ck_c (ddr4_ck_n),
//    .ddr4_ck_t (ddr4_ck_p),
//    .ddr4_cke (c0_ddr4_cke),
    .ddr4_cs_n (c0_ddr4_cs_n),
    .ddr4_dm_n (c0_ddr4_dm_dbi_n),
    .ddr4_dq (c0_ddr4_dq),
    .ddr4_dqs_c (c0_ddr4_dqs_c),
    .ddr4_dqs_t (c0_ddr4_dqs_t),
    .ddr4_odt (c0_ddr4_odt),
    .ddr4_reset_n (c0_ddr4_reset_n),
    .gpio0_i (gpio_i[31:0]),
    .gpio0_o (gpio_o[31:0]),
    .gpio0_t (gpio_t[31:0]),
    .gpio1_i (gpio_i[63:32]),
    .gpio1_o (gpio_o[63:32]),
    .gpio1_t (gpio_t[63:32]),
    .iic_main_scl_io (iic_scl),
    .iic_main_sda_io (iic_sda),
//    .mdio_0_mdc (),
//    .mdio_0_mdio_io (1'b0),
    .mgt_clk_0_clk_n(USER_MGT_SI570_CLOCK2_N),
    .mgt_clk_0_clk_p(USER_MGT_SI570_CLOCK2_P),
//    .mgt_ref_clk_0(mgt_ref_clk),
//    .sgmii_phyclk_clk_n (phy_clk_n),
//    .sgmii_phyclk_clk_p (phy_clk_p),
    .phy_rst_n (),
    .phy_sd (1'b1),
    .ETH_0_RXN (ETH_0_RXN),
    .ETH_0_RXP (ETH_0_RXP),
    .ETH_0_TXN (ETH_0_TXN),
    .ETH_0_TXP (ETH_0_TXP),
    .spi_clk_i (spi_clk_mon),
    .spi_clk_o (spi_clk_mon),
    .spi_csn_i (spi_csn),
    .spi_csn_o (spi_csn),
    .spi_sdi_i (spi_miso_mon),
    .spi_sdo_i (spi_mosi_mon),
    .spi_sdo_o (spi_mosi_mon),
    .sys_clk_clk_n (USER_SI570_N),
    .sys_clk_clk_p (USER_SI570_P),
    .sys_rst (sys_rst),
    .tx_data_0_n (tx_data_n[0]),
    .tx_data_0_p (tx_data_p[0]),
    .tx_data_1_n (tx_data_n[1]),
    .tx_data_1_p (tx_data_p[1]),
    .tx_data_2_n (tx_data_n[2]),
    .tx_data_2_p (tx_data_p[2]),
    .tx_data_3_n (tx_data_n[3]),
    .tx_data_3_p (tx_data_p[3]),
    .tx_data_4_n (tx_data_n[4]),
    .tx_data_4_p (tx_data_p[4]),
    .tx_data_5_n (tx_data_n[5]),
    .tx_data_5_p (tx_data_p[5]),
    .tx_data_6_n (tx_data_n[6]),
    .tx_data_6_p (tx_data_p[6]),
    .tx_data_7_n (tx_data_n[7]),
    .tx_data_7_p (tx_data_p[7]),
    .tx_ref_clk_0 (tx_ref_clk_156),
    .tx_ref_clk_4 (tx_ref_clk_156),
    .tx_sync_0 (tx_sync),
    .tx_sysref_0 (tx_sysref),
    .uart_sin (uart_sin),
    .uart_sout (uart_sout),
    .dac_fifo_bypass (dac_fifo_bypass));

  // AD9161/2/4-FMC-EBZ works only in single link,
  // The FMC connector instead of SYNC1 has SYSREF connected to it
  assign tx_sysref_loc = (DEVICE_CODE == 3) ? tx_sync[1] : tx_sysref;

endmodule

attaching the spi related constraints below:

set_property -dict {PACKAGE_PIN AA1 IOSTANDARD LVCMOS18} [get_ports spi_csn_dac]
set_property -dict {PACKAGE_PIN AB3 IOSTANDARD LVCMOS18} [get_ports spi_csn_clk]
set_property -dict {PACKAGE_PIN AA2 IOSTANDARD LVCMOS18} [get_ports spi_miso]
set_property -dict {PACKAGE_PIN Y1 IOSTANDARD LVCMOS18} [get_ports spi_mosi]
set_property -dict {PACKAGE_PIN Y2 IOSTANDARD LVCMOS18} [get_ports spi_clk]
set_property -dict {PACKAGE_PIN AC3 IOSTANDARD LVCMOS18} [get_ports spi_en]
# For AD916(1,2,3,4)-FMC-EBZ
set_property -dict {PACKAGE_PIN W2 IOSTANDARD LVCMOS18} [get_ports spi_csn_clk2]

# For AD9135-FMC-EBZ, AD9136-FMC-EBZ, AD9144-FMC-EBZ, AD9152-FMC-EBZ, AD9154-FMC-EBZ
set_property -dict {PACKAGE_PIN U5 IOSTANDARD LVCMOS18} [get_ports {dac_ctrl[0]}]
set_property -dict {PACKAGE_PIN U4 IOSTANDARD LVCMOS18} [get_ports {dac_ctrl[3]}]

# For AD9171-FMC-EBZ, AD9172-FMC-EBZ, AD9173-FMC-EBZ
set_property -dict {PACKAGE_PIN AC2 IOSTANDARD LVCMOS18} [get_ports {dac_ctrl[1]}]
set_property -dict {PACKAGE_PIN AC1 IOSTANDARD LVCMOS18} [get_ports {dac_ctrl[2]}]
# For AD916(1,2,3,4)-FMC-EBZ
set_property -dict {PACKAGE_PIN W1 IOSTANDARD LVCMOS18} [get_ports {dac_ctrl[4]}]

It would be really great if someone could guide me on this. Thank you in advance

Thread Notes

Parents
  • Hello danmois,
    I have thoroughly verified all these things once again
    The connections in the HDL are correct
    And i will probe the hmc7044 reset pin on the  evaluation board once to check its reset condition
    Also i wanted to ask is there any fundamental issue in using microblaze in a zynq MPSoC environment where the PS is the master by default?
    Is that the reason ADI does not provide any reference design for the zcu102 with microblaze?

  • Hi,

    By any chance you hardcoded things and DEVICE_CODE remained 0?
    hdl/projects/dac_fmc_ebz/zcu102/system_top.v at main · analogdevicesinc/hdl

    And i will probe the hmc7044 reset pin on the  evaluation board once to check its reset condition

    Any update on this?


    Also i wanted to ask is there any fundamental issue in using microblaze in a zynq MPSoC environment where the PS is the master by default?

    You said you saw activity on your pmod spi clone, I would say no.


    Is that the reason ADI does not provide any reference design for the zcu102 with microblaze?

    We offer separate examples with Microblaze, it would be an improper use of resources.

  • Hello
    Sorry for the delayed response
    Since we were not getting the results on the zcu102 MPSoC and i could not get a chance to probe the hmc7044 reset pin on the evaluation board due to other tasks in hand but i will surely resume the testing on zcu102 and give an update on that
    Meanwhile, we have now moved on to our custom FPGA board with part xcku085flva-1517-2-i. I have migrated the existing ADI HDL to this part and using ADI's  no-os build process i have also generated the vitis application project.
    In our current configuration the DAC sample clock and FPGA clock will be fed externally using an on board lmx2820 so i think the existing hmc7044 init can be removed?
    Also the sysref to the FPGA and DAC shall be given using an lmk08428
    Could you please tell me the changes i need to make on the application side for activating the jesd link.
    Please guide me on this
    Thanks for the assistance so far

  • Hi  

    If your setup replaces the HMC7044 chip with another one, then you will have to use the corresponding driver, if one exists in the repository. If there is no driver, then you will have to add it to your application.

    Regards,

    G

  • I am configuring my clocking device through SPI so that is taken care
    My question is focussed on the larger scheme of things wherein i need to know what other changes have to be made for ad9172 configuration ?
    Thanks

  • Hi  ,

    Debugging custom designs is complicated and we can provide only general guidelines. The init params in main.c and the macros in parameters.h should match your HDL configuration. Furthermore, the clock chip must also be set in the right initial state, and then the JESD FSM handles the bringup sequence.

    Regards,

    G

  • I have verified the init params and parameters.h with respect to the updated HDL and they look ok
    Can i give direct sampling clock to the DAC or shall i feed it the reference clock and let its internal PLL generate the sampling clock as in the original configuration (as per reference design)

Reply Children
  • Hi,

    The AD9172 supports both modes on the same CLKIN+/- pins (page 65 of the dataheet):

    - Direct clocking — supply the full DAC sampling clock (2.91–12.6 GHz),
    - PLL mode — supply a lower reference clock (25 MHz–3.08 GHz depending on M divider) and the on-chip PLL multiplies it up.

    If your LMX2820 can output at the full DAC rate, use direct clocking for best performance. If not, use the PLL.

    Regards,

    G

  • Hi danmois
    I am currently operating in the PLL mode
    After boot up my code is getting stuck at line 236 of main.c

    status = ad9172_init(&ad9172_device, &ad9172_param);
    if (status != 0) {
    printf("ad9172_init() error: %"PRIi32"\n", status);
    goto error_4;
    }


    I am getting the error message as - "ad917x_jesd_config_datapath failed"

    After tracing down to the exact function there seems to be a problem in the ad917x_jesd_api.c file at line 186
    i am getting the value of the tmp_reg as 0xFF
    Is this a jesd configuration issue or an spi communication issue?

    Regards
    Pratik

  • Hi,

    Can you check what ad917x_get_chip_id returned? Seem like an SPI issue, but if ad917x_get_chip_id reads the ID correctly, then this is a problem with the JESD mode/interpolation parameters being written.

    Regards,

    G

  • Hi,

    The chip id is returned as 255 which is 0xFF
    what should the actual value be?
    It looks like an spi issue to me since many of my register reads are returning the data 0xFF
    I have routed the miso,mosi,clk and cs pin to few gpio headers for monitoring their status and will update you once done
    Please let me know what other measures i can take to debug this issue
    Thanks

  • Hi
    I observed the signals on oscilloscope
    I am able to see the CS,clock and mosi properly
    There is no response (miso) from the DAC
    I have verified that the dac is in 4 wire mode and i am currently applying a permanent high to the dac's active low reset
    Is there a reset sequence that needs to be followed?
    Please guide me on this

  • Hi,

    The RESET pin (E8) is active low — holding it permanently high is correct during operation, but the DAC needs a low-to-high transition at power-up to initialize properly. A static high means the internal boot sequence may never trigger, which explains the absent MISO response.

    Try RESET low for ~1 ms, then release high, wait ~1 ms for NVRAM boot, then start SPI.

    See AD9172 datasheet Rev. C, p. 17 & p. 68 (Table 49).

    Regards,

    G

  • Hi
    The spi communication issue has been resolved
    It was related to the reset pin only
    After pulling the reset permanently high it is working
    But the reset sequence you mentioned is already present in the code but it is for the soft reset
    Now the jesd link is established but i am getting sysref alignment error
    My sysref clock is 5.75 MHz and device clock is 368.640 MHz so i have made sure that the sysref clock is an integer sub multiple of the LMFC
    What might be the issue here?

    Thanks

  • Hi,

    Two things to check for start:

    1. Could SYSREF frequency be wrong? 5.75 MHz is not an exact sub-multiple of LMFC (11.52 MHz). It must be exactly 5.76 MHz and even 10 kHz off could cause cumulative drift and alignment failures.
    2. The device clock (LMX2820) and SYSREF (LMK04828) must share the same reference. If they don't, the phase relationship between SYSREF edges and the DAC clock is non-deterministic, causing Subclass 1 sync problems.

    Regards,

    G

  • Hi
    I am sorry the sysref is 5.76. There was a typo by me in my previous response
    Currently the flow of sysref is as below:

    From LMK it is directly going to the FPGA
    LMK08428 -> FPGA

    To the DAC the sysref goes from LMK to LMX where is only passed through to the DAC
    LMK08428 -> LMX2820 -> DAC

    And one more thing
    I am also getting the checksum as 0
    Can this also indicate an issue with the jesd parameter(LMFSK) mismatch?
    I have also attached my terminal snapshot for reference.
    Thanks

  • Hi,

    The zero checksum strongly points to a JESD parameter mismatch between the FPGA transmitter and the DAC receiver. Verify that L, M, F, K, N, NP, S, SCR, and Subclass are identical on both the AXI JESD204 TX IP in your FPGA and the DAC.

    G

Before You Switch


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