02-06-2017 07:17 AM - edited 02-06-2017 07:18 AM
On PetaLinux 2016.4, after recompiling my user application, how do I install it into the downloadable image?
My workflow is currently:
# change some code in myapp.c petalinux-build petalinux-boot --jtag --fpga --kernel
However, petalinux-build takes a long time, so I would like to do something like the following:
# change some code in myapp.c petalinux-build -c myapp petalinux-build -x package petalinux-boot --jtag --fpga --kernel
as described in UG1144 page 55 "Steps to Build User Application". However, this does not work: After Linux boots on the Zynq, the filesystem still contains the previous version of myapp. What's the correct sequence of steps? Thanks in advance fo any help.
02-06-2017 09:08 AM
I think you need to install the compiled application to the target root filesystem before you run the "package" step. Try this step (from the same page in UG1144):
To install the selected user application:
$ petalinux-build -c rootfs/myapp -x do_install
This will install the application into the target rootfs host copy:
<plnx-proj-root>/build/tmp/work/{MACHINE}-linux-gnueabi/petalinu
x-user-image/1.0-r0/rootfs/
02-06-2017 02:19 PM
02-07-2017 06:20 AM
Hi
To build myapp into an existing system image:
$ cd <plnx-proj-root>
$ petalinux-build -c rootfs -x do_gen_sysroot
$ petalinux-build -c myapp
$ petalinux-build -x package
Note: do_gen_sysroot is to generate the sysroot based on the selected prebuilt packages
options from the menuconfig. You do not have to always run do_gen_sysroot before building the
application, but you need to run it at least once before you build the application.
02-13-2017 01:19 AM - edited 02-13-2017 01:21 AM
@Anonymous wrote:
I think you need to install the compiled application to the target root filesystem before you run the "package" step. Try this step (from the same page in UG1144):
To install the selected user application:
$ petalinux-build -c rootfs/myapp -x do_install
This will install the application into the target rootfs host copy:
<plnx-proj-root>/build/tmp/work/{MACHINE}-linux-gnueabi/petalinu
x-user-image/1.0-r0/rootfs/
You mean, like this?
petalinux-build -c myapp petalinux-build -c myapp -x do_install petalinux-build -x package petalinux-boot --jtag --fpga --kernel
This doesn't work: after booting, the version of "myapp" is still the old one.
@stephenm wrote:
You can try petalinux-build -c roots/myapp -x compile
This also didn't help, it still boots with the old version.
@shabbirk wrote:
Hi
To build myapp into an existing system image:
$ cd <plnx-proj-root>
$ petalinux-build -c rootfs -x do_gen_sysroot
$ petalinux-build -c myapp
$ petalinux-build -x package
Note: do_gen_sysroot is to generate the sysroot based on the selected prebuilt packages
options from the menuconfig. You do not have to always run do_gen_sysroot before building the
application, but you need to run it at least once before you build the application.
I did that, but -x do_gen_sysroot doesn't exist in 2016.4:
$ petalinux-build -c rootfs -x do_gen_sysroot ... ERROR: Task do_gen_sysroot does not exist for target petalinux-user-image. Close matches: do_populate_sysroot ...
I replaced it with petalinux-build -c rootfs -x do_populate_sysroot, but it didn't help. I don't think this is where the problem lies, since the file system exists, it just doesn't get updated with new versions of my executable the way it should be.
This is frustrating! UG1144 is out of date (e.g., it still often uses "-c rootfs/myapp" instead of "-c myapp"), and the commands don't behave as described. Is there any documentation what each "-x" command actually does?
01-28-2018 11:55 PM
Hello,
i also ran into a similar problem:
How were you able to include the app in the package ? Any success with the soultion or any alternate way ?
03-08-2018 01:45 AM
Hi @awillen
I was wondering if you have managed to solve this issue, because I run into the same problem.
I am trying to build only my app and not the whole petalinux project by following the UG1144 i.e.
$ petalinux-build -c myapp
$ petalinux-build -x package
$petalinux-package --boot --force --fsbl myfsbl.elf --fpga mybit.bit --u-boot
but it seems when i execute the app from /usr/bin is not the updated one.
The only command that worked for me is
$ petalinux-build
Thanx in advance
03-08-2018 01:58 AM - edited 03-08-2018 01:58 AM
@amatsaka wrote:Hi @awillen
I was wondering if you have managed to solve this issue, because I run into the same problem.
No, I gave up and just did petalinux-build every time I wanted to create a new image. For quick tests, I used
petalinux-build -c APP_NAME -x do_compile
and copied the executable from
build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/APP_NAME/1.0-r0/PATH/APP_NAME
to the running system using scp.