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: 
Observer jim.henderson
Observer
678 Views
Registered: ‎06-04-2018

Cross-development of application using RFdc driver

I have developed a custom ZU27-based RFSoC product.  Using the 2018.3 version of Vivado, the SDK and the Petalinux toolchain and referencing Wiki document Creating Linux application targeting the RFDC driver in SDK 2018.3, I have successfully embedded the RFdc driver and it's example programs within the target linux environment.  The resulting xrfdc-selftest example runs under Linux on our target platform.   

However, the process of embedding pre-written example code into the petalinux image is wholly insufficient for development of new custom applications.   For that, it is imperative that I be able to interactively cross-compile and cross-debug custom applications which make use of the RFdc driver from within the Vivado SDK.  

I have generated the SDK files using the petalinux commands:

petalinux-build --sdk
petalinux-package --sysroot

 

But, I can find no documentation detailing how to use the generated sdk tree to facilitate cross-development from the Vivado SDK.  

I have searched the entire petalinux project tree and have not located any RFdc library files or headers that would enable cross-development of custom applications using this driver.  

By contrast, I have been able to find and make use of the openAMP libmetal headers and libmetal.so library (which were generated into the petalinux project tree by the above commands) to cross-develop and debug applications that access the features of this library using custom C++ code and the Xilinx SDK.  

I seek a similar capability to access the RFdc driver from within applications developed using the Xilinx SDK and custom C++ code.  Please detail this process or provide a reference containing this information.  

Jim

0 Kudos
2 Replies
Observer jim.henderson
Observer
648 Views
Registered: ‎06-04-2018

Re: Cross-development of application using RFdc driver

I have discovered how to cross-compile applications employing the rfdc driver, which is dependent on the libmetal library.  In hopes of benefiting others, I have added the notes below. 

The wiki linked in my earlier post is sufficient to build the rfdc driver and Xilinx-supplied test code into the target petalinux image.  But I failed to grok the significance of the instructions: 

petalinux-build --sdk
petalinux-package --sysroot

 

specified within the wiki which generate headers and library files within the petalinux image that may be referenced within user Xilinx SDK projects to cross-compile applications making use of the rfdc driver and/or metal library.  

The specific changes needed to Xilinx SDK projects are detailed within the Libmetal and OpenAMP for Zynq Devices User Guide.  Chapter 2, section "Build Libmetal Linux Demo in Xilinx SDK" details the steps required.   Insure that the "sysroot" setting within the Project Properties | Tool Settings tab | Settings | Miscellaneous | Linker Flags points to the root of your petalinux generated sdk/ tree.  In my case, I created a symbolic link to the sdk tree at /home/jim/share/projects/PXIE-1000/images/linux/sdk, so my corresponding sysroot specification was: 

"--sysroot=/home/jim/share/projects/PXIE-1000/images/linux/sdk/sysroots/aarch64-xilinx-linux"

Then, to allow the xrfdc and metal headers to be found during compilation, I added the include path

../../sdk/usr/include

to Project Properties | Tool Settings tab | Settings | Directories | Include Paths within my SDK project.  

Finally, I added metal and rfdc to the libraries within 

Project Properties | Tool Settings tab | Settings | Libraries in my project.  

Subsequently, my C++ application successfully cross-compiled and ran on my ZU27 target.  

 
Observer rmohammadnia
Observer
95 Views
Registered: ‎09-12-2018

Re: Cross-development of application using RFdc driver

Thanks a lot for sharing your finidngs. That actually took me out of the rabit hall after couple days of spining.

 

Cheers,

Reza

0 Kudos