cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
3,540 Views
Registered: ‎05-23-2017

How to add application binary to petalinux? is it should be a .elf file?

Hi,

 I am following the UG1144 page50 to include prebuilt applications to petalinux.

 

1.Create an application with the following command.
    $ petalinux-create -t apps --template install --name myapp --enable

2Change to the newly created application directory.
   $ cd <plnx-proj-root>/project-spec/meta-user/recipes-apps/myapp/files/
3. Remove existing myapp app and copy the prebuilt myapp.
   $ rm myapp
   $ cp <path-to-prebuilt-app> .

 

In my case the prebuilt myapp is a .elf file from the SDK (using a standalone application project) .

After I copy the .elf to the location mentioned on the 3rd steps and execute "petalinux-build" commond, a error show up:

ERROR: Nothing RPROVIDES 'helloworldSanJose' (but /home/petalinux_project/armcore_project0606/for_test_lib/project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb RDEPENDS on or otherwise requires it)

Then I checked the helloworldSnajose.bb  file.

#
# This file is the helloworldSnajose recipe.
#

SUMMARY = "Simple helloworldSnajose application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://helloworldSnajose \
	"

S = "${WORKDIR}"

do_install() {
	     install -d ${D}/${bindir}
	     install -m 0755 ${S}/helloworldSnajose ${D}/${bindir}
}

 I didn't find some hint from that.

 

But when I build a template $ petalinux-create -t apps --template install --name myapp --enable, notice the binary file has no .elf.

 

Now I am confuse with which kind of binary file should I put in the petalinux?

0 Kudos
5 Replies
Highlighted
Observer
Observer
1,204 Views
Registered: ‎09-06-2018

Re: How to add application binary to petalinux? is it should be a .elf file?

Hi mathmaxsean

first of all, I think that you shoul compile the application for the linux enviroment.

Standalon and linux are two different worlds.

Hope that this shoul be helpful for you.

Bye

0 Kudos
Highlighted
Observer
Observer
1,189 Views
Registered: ‎08-28-2018

Re: How to add application binary to petalinux? is it should be a .elf file?

Hello @mathmaxsean,

 

What I can see is the following:

install -m 0755 ${S}/helloworldSnajose ${D}/${bindir}

 

Look at how you did Snaj? And the error says: 

Nothing RPROVIDES 'helloworldSanJose'

 

Maybe because you install helloworldSnaJose and SanJose.

 

**Also make sure the .elf file is compiled with the same compiler as your kernel uses.

0 Kudos
Highlighted
Adventurer
Adventurer
1,052 Views
Registered: ‎09-08-2016

回复: How to add application binary to petalinux? is it should be a .elf file?

Please try as the picture shown

Image 1.png

 

 

0 Kudos
Highlighted
Participant
Participant
314 Views
Registered: ‎12-09-2019

Re: How to add application binary to petalinux? is it should be a .elf file?

You will ahve to edit the bb file to properly build the new app.

 

#
# This file is the helloworldSnajose recipe.
#

SUMMARY = "Simple helloworldSnajose application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://helloworldSnajose.elf \
	"

S = "${WORKDIR}"
INSANE_SKIP_${PN} = "arch"
do_install() {  
install -d ${D}/lib/firmware
install -m 0755 ${S}/helloworldSnajose.elf ${D}/lib/firmware
}
FILES_${PN} = "/lib/firmware/helloworldSnajose.elf"

 

Do change this as your .bb file.

regards...

0 Kudos
Highlighted
Explorer
Explorer
281 Views
Registered: ‎08-02-2019

Re: How to add application binary to petalinux? is it should be a .elf file?

Hi @mathmaxsean ,

I'm doing same thing with Vivado/SDK/Petalinux 2018.2.

First thing is first. If you want to have a Petalinux application, you need to create it again in Xilinx SDK as Linux application.

Bare Metal needs BSP project to work properly and it is completly different.

After recreating your project, you can build it in SDK and If you can build it without errors, you can go next step.

By using SDK, you can also debug your Linux by using Hardware Debug(I found this feature wonderful.)

Whenever you are sure, everything is fine, then I copy-paste to my source files into related folder in Petalinux apps.(<plnx-proj-root>/project-spec/meta-user/recipes-apps/myapp/files/)

It means, instead of copying executable, I'm copying sources.

Then, petalinux-build builds also our application.

If you want to build only your project and do not want to wait too long time, then you can use:

petalinux-build -c my_app -x cleanall

petalinux-build -c my_app

Regards,

Saban 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos