UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant chaooxford
Participant
834 Views
Registered: ‎05-16-2018

ZCU111 board LMX clock programming

Hi, 

I am trrying to set up a simple block design with rfdc. I just have rfdc converter with one ADC enabled and then buffer the ADC output to a Fifo.

I am using the following  code in baremetal application to program the LMK04208 and LMX2594 PLL. The application can launched successfully, but it does not generate the clock signal and there is no data ouput from the ADC( I have attache an ILA at the output data of rdfc, and it said no clock stop and not armed). Any idea of what could be wrong? Also, what is the exact meaning of the following code? Which tile clock has been connected? Is the clock generated by LMX2594 3932160 kHz?  

#ifdef XPS_BOARD_ZCU111
printf("\n Configuring the Clock \r\n");
#ifdef __BAREMETAL__
LMK04208ClockConfig(1, LMK04208_CKin);
LMX2594ClockConfig(1, 3932160);
#else
LMK04208ClockConfig(12, LMK04208_CKin);
LMX2594ClockConfig(12, 3932160);
#endif
#endif

0 Kudos
12 Replies
Moderator
Moderator
816 Views
Registered: ‎04-18-2011

Re: ZCU111 board LMX clock programming

Hi @chaooxford 

I see you have posted another thread about this issue with with the clock not being programmed. 

https://forums.xilinx.com/t5/UltraScale-Architecture/RFSoC-simple-ADC-project-no-effective-clock-generated-by-LMX/td-p/957029

which version of the driver are you using.

there was an issue before where the loop that was used to pick the settings was not properly constructed. 

Can you try the latest version of the xrfdc_clk.c andsee if it works.

Are the LEDs on the ZCU111 board coming on to indicate the PLLs are locked on the board?

Keith 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Participant chaooxford
Participant
809 Views
Registered: ‎05-16-2018

Re: ZCU111 board LMX clock programming

Hi @klumsde  

Thanks for your reply.

I am using the code from this link. Is it the latest? Which are the LEDs indicate PLL lock? 

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/rfdc/examples/xrfdc_clk.c

I am using the following as main.

The COM5 do the following and stucked XRFdc_GetIPStatus. Any idea what is wrong with that?

Configuring the Clock
LMK04208 configuration write done
LMX configured to frequency 5120000
I2c1 I2CTOSPI LMX2594 PLL configuration done

Configured the Clock

int main(void)
{
int Status;
u16 Tile;
u16 Block;
XRFdc *RFdcInstPtr = &RFdcInst;
XRFdc_Config *ConfigPtr;
XRFdc_BlockStatus BlockStatus;
XRFdc_IPStatus myIPStatus;

printf("RFdc Selftest Example Test\r\n");
/*
* Run the RFdc Decoder Mode example, specify the Device ID that is
* generated in xparameters.h.
*/
/* Initialize the RFdc driver. */
ConfigPtr = XRFdc_LookupConfig(RFDC_DEVICE_ID);
if (ConfigPtr == NULL) {
return XRFDC_FAILURE;
}

Status = XRFdc_CfgInitialize(RFdcInstPtr, ConfigPtr);
if (Status != XRFDC_SUCCESS) {
return XRFDC_FAILURE;
}
#ifdef XPS_BOARD_ZCU111
printf("\n Configuring the Clock \r\n");
#ifdef __BAREMETAL__
LMK04208ClockConfig(1, LMK04208_CKin);
LMX2594ClockConfig(1, 5120000);
printf("\n Configured the Clock \r\n");
#else
LMK04208ClockConfig(12, LMK04208_CKin);
LMX2594ClockConfig(12, 5120000);
printf("\n Configured the Clock bb \r\n");
#endif
#endif

Status = XRFdc_GetIPStatus(RFdcInstPtr, &myIPStatus);
if (Status != XRFDC_SUCCESS) {
return XRFDC_FAILURE;
printf("\n Get IP statue \r\n");
}

int powerup_status;
int tile_state;
powerup_status = myIPStatus.ADCTileStatus[0].PowerUpState;
tile_state = myIPStatus.ADCTileStatus[0].TileState;

printf("ADC PowerUp Status: %u\n", powerup_status);
printf("ADC Tile State: %u\n", tile_state);

int whole, thousandths; // will need these for the doubles not supported by xil_printf

/*print out the ADC status*/
Status = XRFdc_GetBlockStatus(RFdcInstPtr, XRFDC_ADC_TILE, 0, 0, &BlockStatus);
if (Status != XRFDC_SUCCESS) {
return XRFDC_FAILURE;
}

whole = BlockStatus.SamplingFreq;
thousandths = (BlockStatus.SamplingFreq - whole) * 1000;
printf("ADC Sampling Frequency: %d.%3d\n",whole,thousandths);

Tile = 0x0;
for (Block = 0; Block <4; Block++) {
if (XRFdc_IsADCBlockEnabled(RFdcInstPtr, Tile, Block)) {
printf("\n tile %d block %d is available \r\n", Tile, Block);
if (RFdcInstPtr->ADC4GSPS == XRFDC_ADC_4GSPS) {
if ((Block == 2) || (Block == 3))
continue;
else if (Block == 1) {
if (XRFdc_IsADCBlockEnabled(RFdcInstPtr, Tile, 2) == 0)
continue;
}
}
}
}
xil_printf("Successfully ran Selftest Example Test\r\n");
return XRFDC_SUCCESS;
}

0 Kudos
Moderator
Moderator
782 Views
Registered: ‎04-18-2011

Re: ZCU111 board LMX clock programming

the code there is not correct. line 554 of xrfdc_clk.c shows the loop that is used to select the frequency. 

for(XFreqIndex=0 ; XFreqIndex<20; XFreqIndex++) {
if (ClockingLmx[XFreqIndex].XFrequency == XFrequency) {
Lmx2594Updatei2c( XIicDevFile, ClockingLmx[XFreqIndex].LMX2594_A);
return 0;
}
}

The problem is the loop only goes to 20. 

you should change the loop so it looks like

for(XFreqIndex=0 ; XFreqIndex < sizeof(ClockingLmx) / sizeof(ClockingLmx[0]); XFreqIndex++)

 

Keith 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Participant chaooxford
Participant
770 Views
Registered: ‎05-16-2018

Re: ZCU111 board LMX clock programming

Hi @klumsde 

 

Thanks for you reply.

Following the clock configuration, I had the code below.

int powerup_status;
int tile_state;
powerup_status = myIPStatus.ADCTileStatus[0].PowerUpState;
tile_state = myIPStatus.ADCTileStatus[0].TileState;

printf("ADC PowerUp Status: %u\n", powerup_status);
printf("ADC Tile State: %u\n", tile_state);

It print the as follows:

ADC PowerUp Status: 0
ADC Tile State: 7

Is it means the ADC is not powered up somehow.

Do i need to program the rfdc in the C code? Or anything else might be the cause?

Best regards,

Chao

0 Kudos
Moderator
Moderator
768 Views
Registered: ‎04-18-2011

Re: ZCU111 board LMX clock programming

it is stuck at clock detect I think

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Participant chaooxford
Participant
765 Views
Registered: ‎05-16-2018

Re: ZCU111 board LMX clock programming

Hi @klumsde 

I have make the change you suggested. 

for(XFreqIndex=0 ; XFreqIndex < sizeof(ClockingLmx) / sizeof(ClockingLmx[0]); XFreqIndex++)

Is there anything else need to be configured?

Best,

Chao

0 Kudos
Participant chaooxford
Participant
749 Views
Registered: ‎05-16-2018

Re: ZCU111 board LMX clock programming

Hi @klumsde 

I have make the change you suggested. 

for(XFreqIndex=0 ; XFreqIndex < sizeof(ClockingLmx) / sizeof(ClockingLmx[0]); XFreqIndex++)

It still prints the same as before, which indicate the ADC is not powered up.

Configured the Clock
ADC PowerUp Status: 0
ADC Tile State: 7

Is there anything else need to be configured?

Best,

Chao

0 Kudos
Moderator
Moderator
746 Views
Registered: ‎04-18-2011

Re: ZCU111 board LMX clock programming

As a sanity check can you program this frequency over the system controller? SCUI?
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Participant chaooxford
Participant
739 Views
Registered: ‎05-16-2018

Re: ZCU111 board LMX clock programming

Hi @klumsde

I have found that I have used the wrong block number in the following code#

 Status = XRFdc_GetBlockStatus(RFdcInstPtr, XRFDC_ADC_TILE, 0, 1, &BlockStatus);
if (Status != XRFDC_SUCCESS) {
return XRFDC_FAILURE;
}

It not longer stucked it the code above and printed ADC Sampling Frequency: 4. 96 with code below.

 whole = BlockStatus.SamplingFreq;
thousandths = (BlockStatus.SamplingFreq - whole) * 1000;
printf("ADC Sampling Frequency: %d.%3d\n",whole,thousandths); 

But it still prints ADC PowerUp Status: 0 ADC Tile State: 7 for ADC tile check.

Is there any document about ADCTileStatus?

Best,

Chao

 

 

0 Kudos
Contributor
Contributor
655 Views
Registered: ‎11-21-2018

Re: ZCU111 board LMX clock programming

I have the same problem,

ADC PowerUp Status: 0
ADC Tile State: 7

ADC Sampling Frequency: 3.932

ADC00 Status AnalogDataPathStatus - 1
DigitalDataPathStatus - 801
DataPathClockStatus - 0
IsFIFOFlagsEnabled - 3
IsFIFOFlagsAsserted - 0
ADC Mixer Frequency: -499.-999

Has anyone found the solution to this problem? I tried to change the version of xrfdc_clk.c but it has no effect.

@chaooxford 

0 Kudos
Highlighted
Observer aswejk
Observer
578 Views
Registered: ‎05-21-2018

Re: ZCU111 board LMX clock programming

Was having same issue.

If ADC tile status is 6 I believe that's indicating the LMK is not configured

If ADC tile status is 7 I believe that's indicating the LMX is not configured

 

I generated clock programming files from the TI TICS application and could configure the clocks using the SCUI example.  I don't believe I ever got the baremetal code to configure the clocks.

 

We're running linux now so I used the bootscript from here as a template:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/84541826/Programming+Clocks+on+the+ZCU111#ProgrammingClocksontheZCU111-Usingi2c-toolstoprogramtheLMKandLMXdevices:

 

Configuring the Si5382 was not necessary for me.

 

One missing detail from the bootscript.  Per the LMX2594 data sheet; after programming the registers, wait 10ms and program the R0 register one more time with the same value.  So, maybe this is also missing from the xfrdc_clk.c example?

 

Cheers

 

0 Kudos
Contributor
Contributor
514 Views
Registered: ‎11-21-2018

Re: ZCU111 board LMX clock programming

Hi,

Thank you for your answer @aswejk .

I think I understand and you are right.

I removed the PLL enable to try to find another solution.

In fact, to configure it is necessary to program the converters once through the TICS Pro application, then the code under SDK works and allows to configure the frequency of the LMX2594 and the LMK04208. So the problem probably comes from the initialization of the registers because the 10 ms pause is correctly programmed with sleep(10). (see code screenshot). Is there a known and solved problem with this initialization of clock registers? @klumsde 

Kind regards,

code.JPG
0 Kudos