AnsweredAssumed Answered

MYKONOS_ERR_WAITFOREVENT_TIMEDOUT_CLKPLL_LOCK

Question asked by filabrasil on Jul 21, 2017
Latest reply on Jul 27, 2017 by filabrasil

I've been trying to make the basic AD9371 NO OS code work for zc706 board following AD9371/AD9375 No-OS Setup [Analog Devices Wiki] . I generated headless.c from TES GUI version 2067 with all TX1,TX2,RX1,RX2 active. The file I generated does not contain initialization for the  ad9528 so I added it using the codes in the old headless.c inside the NO OS code folder in github.

The main code is shown below.

int main()
{
    ADI_ERR    ad9528Error;
    ad9528Device_t         *clockAD9528_device = &clockAD9528_;
    const char* errorString;
    uint8_t mcsStatus = 0;
    uint8_t pllLockStatus = 0;
    uint8_t binary[983] = {0};  /*** < Action: binary should contain ARM binary file as array  > ***/
    uint32_t count = sizeof(binary);
    uint8_t errorFlag = 0;
    uint8_t errorCode = 0;
    uint32_t initCalsCompleted = 0;
    uint16_t errorWord = 0;
    uint16_t statusWord = 0;
    uint8_t status = 0;
    mykonosInitCalStatus_t initCalStatus = {0};

 

    uint8_t deframerStatus = 0;
    uint8_t obsFramerStatus = 0;
    uint8_t framerStatus = 0;
    
    uint32_t initCalMask = 0 |
      TX_BB_FILTER |
      ADC_TUNER |
      TIA_3DB_CORNER |
      DC_OFFSET |
      TX_ATTENUATION_DELAY |
      RX_GAIN_DELAY |
      FLASH_CAL |
      PATH_DELAY |
      LOOPBACK_RX_LO_DELAY |
      LOOPBACK_RX_RX_QEC_INIT |
      TX_LO_LEAKAGE_INTERNAL |
      TX_QEC_INIT |
      RX_LO_DELAY |
      RX_QEC_INIT;

 

    uint32_t trackingCalMask = 0 |
      TRACK_ORX1_QEC |
      TRACK_ORX2_QEC;

 

    mykonosErr_t mykError = MYKONOS_ERR_OK;
    mykonosGpioErr_t mykGpioErr = MYKONOS_ERR_GPIO_OK;

 

    /* Allocating memory for the errorString */
    errorString = (const char*) malloc(sizeof(char) * 200);

 

    /*** < Action: Insert System Clock(s) Initialization Code Here          > ***/
    /* Allocating memory for the errorString */
    errorString = (const char*) malloc(sizeof(char) * 200);

 

    printf("Please wait...\n");

 

    platform_init();

 

    /**************************************************************************/
    /*****      System Clocks Initialization Initialization Sequence      *****/
    /**************************************************************************/

 

    /* Perform a hard reset on the AD9528 DUT */
    ad9528Error = AD9528_resetDevice(clockAD9528_device);
    if (ad9528Error != ADIERR_OK) {
        printf("AD9528_resetDevice() failed\n");
        return ad9528Error;
    }

 

    ad9528Error = AD9528_initDeviceDataStruct(clockAD9528_device, clockAD9528_device->pll1Settings->vcxo_Frequency_Hz,
                                              clockAD9528_device->pll1Settings->refA_Frequency_Hz,
                                              clockAD9528_device->outputSettings->outFrequency_Hz[1]);
    if (ad9528Error != ADIERR_OK) {
        printf("AD9528_initDeviceDataStruct() failed\n");
        return ad9528Error;
    }

 

    /* Initialize the AD9528 by writing all SPI registers */
    ad9528Error = AD9528_initialize(clockAD9528_device);
    if (ad9528Error != ADIERR_OK)
        printf("WARNING: AD9528_initialize() issues. Possible cause: REF_CLK not connected.\n");

 

    /* Initialize CLKGENs */
    status = clkgen_setup(&mykDevice);
    if (status != 0) {
        printf("clkgen_setup() failed\n");
        return -1;
    }

 

    /* Initialize JESDs */
    status = jesd_setup(&mykDevice);
    if (status != 0) {
        printf("jesd_setup() failed\n");
        return -1;
    }

 

    /*** < Action: Insert BBIC Initialization Code Here                     > ***/

 

    /*************************************************************************/
    /*****                Mykonos Initialization Sequence                *****/
    /*************************************************************************/

 


    /*** < Action: Toggle RESETB pin on Mykonos device                   > ***/
    if ((mykError = MYKONOS_resetDevice(&mykDevice)) != MYKONOS_ERR_OK)
    {
        /*** < Info: errorString will contain log error string in order to debug failure > ***/
        errorString = getMykonosErrorMessage(mykError);
    }

 

    if ((mykError = MYKONOS_initialize(&mykDevice)) != MYKONOS_ERR_OK)
    {
        /*** < Info: errorString will contain log error string in order to debug failure > ***/
        errorString = getMykonosErrorMessage(mykError);
    }

 

The problem is that the code returns the error "Clock PLL Lock event timed out in MYKONOS_waitForEvent()". Note that I connected a 30.72MHz clock as instructed so I don't know what else to do.

 

Any help will be appreciated.

Outcomes