12-19-2018 12:13 AM - edited 12-19-2018 10:54 PM
I'm trying to create a linux application for the petalinux project that is already built and booted from SD card in zynq board zcu102,
I followed the official video How to Create Linux Applications using Xilinx SDK which introduced create and debug of the petalinux on zynq device .
In the video the toolchain and linux system root was not set, I read somewhere that the paths are set by default if not set.
in the video:
But when I followed the video and created a hello world( on windows machine as the video ,and also didnot set toolchain and linux system root), and copied the compiled elf executable to the linux environment,
It cannot run and reports a weird message stating that itself does not exist (the name of the executable is "hello_world2.elf" ):
root@xilinx-zcu102-2017_3:/run/media/mmcblk0p1# ./hello_world2.elf -sh: ./hello_world2.elf: No such file or directory
I figured that may be it's the system root and toolchain problem, so I moved to linux machine, started the xsdk and tried to find the system root and toolchain for the petalinux project that booted on the zcu102.
The toolchain was easily found under the recommended directory "$PETALINUX/tools/linux-i386/gcc-arm-linux-gnueabi", but the system root dir sdk suggested from "<petalinux project dir>/build/linux/rootfs/stage" is not so easy to find, as I searched under the project dir, there is no such directory.
So is this recommended directory obsolete or the video is not applicable now ? I'm using a 2017.3 version while the UI in the video seems not so recent.
I also followed the video to the remote debug part, the envrironment is also different for me, there is a "Remote ARM Linux Application" tab in the run configuration, which is missing for me:
I also checked the "Linux TCF Agent", and the "test connection" succeeds.
I'm certainly missing something, but how do I do it right?
There is also a chapter " Creating and Adding Custom Applications" in ug1144 which setup a application project by commands and makefile
petalinux-create -t apps --template c++ --name myapp --enable
$ petalinux-build -x do_populate_sysroot
$ petalinux-build -c rootfs
$ petalinux-build -x package
$ petalinux-build -c helloworld
which seems an approach that integrates application to linux, which seems not so convenient for debug compared to xsdk's eclipse approach.
I also followed the steps in the ug1144 to install the built helloworld:
To install the selected user application: $ petalinux-build -c helloworld -x do_install This will install the application into the target rootfs host copy: <TMPDIR>/work/plnx_aarch64-xilinx-linux/petalinux-user-image/1.0-r0/rootfs/
and after doing so, there is also no such folder "rootfs" in the position:
works fine and the "helloworld" is put into the /usr/bin/ folder of the petalinux system.
I'm still looking for how to do this within/outside the xsdk and can debug the linux application using the xsdk from remote board.
01-10-2019 10:15 AM - edited 01-10-2019 10:17 AM
So after you ave completed petalinux-build you should have a sysroot to point to in the SDK.
When I build 2017.3 petalinux, My sysroot directory is created in
When I use the SDK to create a Linux app for the A53, I check the "Linux System Root"
checkbox and put the above directory entry into the text field.
The other place I set this at is in the
project/properties/C/C++ build/settings/ARM v8 Linux gcc Linker/Miscellaneous
Linker Flags field.
Here it looks like this
Hope this helps.