cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
3,064 Views
Registered: ‎10-08-2016

move bare metal (standalone) app to linux

Jump to solution

I've reached the point where I'm hunkered down developing a non-trivial app to run under Petalinux on a Zedboard.  My  traditional approach, which is to use Vim and its built-in :make command, has always stood me in good stead, but in the context of Petalinux's build concept, it kind of breaks down.  My stop-gap solution is to make a small change to the Makefile so I can use my normal tools until time to actually test the code.  The changes are these:

 

#include apps.common.mk
CXX = $(PETALINUX)/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/arm-xilinx-linux-gnueabi-g++

 

and after I get the code to compile with ":make build", then I switch the comment marks, go back to the project level and run petalinux-build.

 

But I'm constrained to believe there's a better way.  Is it to use Vivado SDK?  I've only figured out how to use that for stand-alone apps, and this is a Linux app.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
5,522 Views
Registered: ‎06-08-2015

Yes, I prefer Xilinx SDK for PetaLinux app development. The trick is to let PetaLinux build an app and, in the build log, examine the command lines it uses to compile and link the application. Then, put the command line parameters into the "C/C++ Build Settings" in your SDK project's properties. You'll need access to your PetaLinux project's libraries and include files (in the directory indicated by the "sysroot" option).

View solution in original post

4 Replies
Highlighted
Explorer
Explorer
3,054 Views
Registered: ‎10-08-2016

The subject line of the orginal post somehow got copied from a thread I was examining when I made the original post.

0 Kudos
Highlighted
Adventurer
Adventurer
5,523 Views
Registered: ‎06-08-2015

Yes, I prefer Xilinx SDK for PetaLinux app development. The trick is to let PetaLinux build an app and, in the build log, examine the command lines it uses to compile and link the application. Then, put the command line parameters into the "C/C++ Build Settings" in your SDK project's properties. You'll need access to your PetaLinux project's libraries and include files (in the directory indicated by the "sysroot" option).

View solution in original post

Highlighted
Scholar
Scholar
3,028 Views
Registered: ‎05-28-2013
You can totally keep using vim and :make... in fact you can even write the makefile by yourself so that you are not tied to how petalinux sets things up. If you know how to compile "hello_world" by calling gcc (or g++), cross-compiling is mostly a matter of switching the name of the compiler, as you have already found.

After you compiled your standalone app, you'll want to test it, which means copying it to your Zedboard. This can be done with "scp" or "rsync" or similar tools, even "ftp" or NFS sharing could be used. If you like, you can put this step in your makefile too, for convenience.

The officially supported method from Xilinx is to use Vivado SDK and petalinux, but it is not the only way. Some people like the big GUI tools, some like small command line stuff and vi. Both are workable.
Highlighted
Explorer
Explorer
3,016 Views
Registered: ‎10-08-2016

Thanks to both of you @rfs613 and @gwhite.  The forum would only let me mark one as a solution, but I'm sure I'll be using both.

0 Kudos