cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
3,100 Views
Registered: ‎09-12-2018

ZCU111 RFDC Bare Metal Example

Jump to solution

Hi,

 

 

I created a simple PS + PL Vivado project. The RF DAC is connected to the PS via AXI Interconnect (Vivado Block Design: Run Automation). The RF DAC AXIS interface is driven by some simple FPGA logic. Therefore, I want to write a bare metal application in SDK to simply bring the RF DAC live and then I expect the FPGA logic to drive it.

 

I built the bitstream and exported the hardware file to SDK. I ran into two problems:

 

First, in SDK, when creating a new application, there is a high probability (about 1 in 4) that SDK crashes and closes itself. If I try to re-launch SDK and choose the same workspace, it will launch but immediately close itself. It appears that the new application directories are corrupted. The only fix I found so far is deleting the corrupted directories. Is there something I am missing here?

 

Second, I studied and copied the bare metal examples located in Xilinx\SDK\2018.2\data\embeddedsw\XilinxProcessorIPLib\drivers\rfdc_v4_0\examples. I created a new empty application and copied

 

xrfdc_clk.h

xrfdc_clk.c

xrfdc_selftest_example.c

 

SDK complains that


LMK04208ClockConfig

LMX2594ClockConfig

 

are undefined. However, they are indeed defined in xrfdc_clk.h

 

This seems like some Makefile issue. I checked the linker settings (see attached screenshots) but it looks normal. Am I missing something obvious and silly here?

 

 

Many Thanks.

rfdc_clk_h.jpg
gcc_linker.jpg
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
3,014 Views
Registered: ‎11-13-2017

Hi,
About undefined reference errors, same here.
As a workaround, I added "#define XPS_BOARD_ZCU111" in the code:
Screenshot.png

Then it works.

View solution in original post

9 Replies
Highlighted
Moderator
Moderator
3,076 Views
Registered: ‎04-18-2011
Hi,
I can take a look at this.
I have seen it complain about lib metal and xrfdc sometimes when I ask it to create a BSP when the application is being created.
This is rare but I never see it crash.
I find I never get issues if I build my BSP first then use it for my application.

I don't have problems with these clock files when I include them...
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
3,063 Views
Registered: ‎09-12-2018

I had the same complaint from the BSP about libmetal as well, but that was easily solved by clicking libmetal under BSP Settings -> Overview.

 

Just to be sure it was not my HDF or bitstream being the culprit, I created a new hardware project using the HDF that came with the evaluation .zip file (zcu111_rfsoc_trd_wrapper.hdf). Then, I created a new BSP and a new application project. I imported the same 3 files into the same directory:

 

xrfdc_clk.h

xrfdc_clk.c

xrfdc_selftest_example.c

 

Once again, I get undefined reference to functions which are defined in xrfdc_clk.h and implemented in xrfdc_clk.c

0 Kudos
Highlighted
Moderator
Moderator
3,028 Views
Registered: ‎04-18-2011

No the problem I experienced was not because I didn't tick the lib metal option.
I had sdk complaining about not being able to see. h files that were clearly included in the driver.
Making the bsp before creating the application caused this to go away.
I never saw it crash at all

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
3,015 Views
Registered: ‎11-13-2017

Hi,
About undefined reference errors, same here.
As a workaround, I added "#define XPS_BOARD_ZCU111" in the code:
Screenshot.png

Then it works.

View solution in original post

Highlighted
2,987 Views
Registered: ‎09-12-2018

Thanks. The problem was that in xrfdc_clk.c, the entire file was

 

#ifdef XPS_BOARD_ZCU111

etc

#endif

 

So without XPS_BOARD_ZCU111 defined, the compiler was ignoring the entire file. I believe the intent from Xilinx is to define it -D in the compiler flags, i.e., -D XPS_BOARD_ZCU111 but explicitly defining in the source code works too.

 

Now that I got the examples working, I got two questions.

 

First, what is the fabric rate? I see a few API functions setting and reading it. It seems to be some sort of integer. I searched through PG269 but I couldn't find anything except the functions.

 

int XRFdc_SetFabWrVldWords (XRFdc* InstancePtr, int Tile_Id, u32 Block_Id, u32 FabricWrVldWords);

Arguments
• XRFdc* InstancePtr: Pointer to the driver instance.
• int Tile_Id: RF-DAC tile number. Valid values are 0-3.
• u32 Block_Id: RF-DAC number inside the tile. Valid values are 0-3.
• u32 FabricWrVldWords: Write fabric data rate to be set for RF-DAC.
Description
This API function sets the write fabric data rate for the requested RF-DAC by writing to the
corresponding register.
Note : This API function is only applicable for RF-DACs.

Second, I used XRFdc_GetBlockStatus to check my design. One of the returned values is the sampling rate. I got 97194. Is that in Hertz?

 

FYI when I created the RF DAC block in Vivado, I set the sampling rate to 3.2 GSPS (see attached).

 

vivado_rfdc_1.jpg
vivado_rfdc_2.jpg
0 Kudos
Highlighted
Contributor
Contributor
2,139 Views
Registered: ‎11-21-2018

Hi, I am trying to test the DAC with the same configuration but I have a problem and maybe you had the same.

probleme sdk.JPG

probleme sdk3.JPG

What run configuration do you use? What is the result expected?

Do you fin a way to see an output with a spectrum analyser by this way (Vivado + SDK with baremetal examples) ?

 probleme sdk2.JPG

 

I hope you can help me.

Thank you.

0 Kudos
Highlighted
Adventurer
Adventurer
1,733 Views
Registered: ‎11-10-2017

Hello ,

 

I have been trying to make a custom built bare-metal example to access ADC/DAC. Please have a look at my problem here :

https://forums.xilinx.com/t5/Evaluation-Boards/ZCU111-RFDC-Example-Design-Cutomization-Issue/td-p/992544

If you have made the xrfdc_read_write_example to work, i hope the steps would be a great help for me. 

 

Thanks again ! 

 

0 Kudos
Highlighted
1,605 Views
Registered: ‎07-18-2019

Hello,

I tried to replicate your design and run the bare metal example. However, I was not able to see a sine wave in the oscillocospe. I only have a constant voltage. Can you please help me with that?

 

Thanks.

0 Kudos
Highlighted
Visitor
Visitor
354 Views
Registered: ‎02-18-2020

Hi,

Even I am trying to generate a sine wave using ZCU111 board. Can you help me out, where do we get the circuit / block diagram for that ? How did you arrive at your block diagram ?

0 Kudos