cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MrGorji
Observer
Observer
409 Views
Registered: ‎07-18-2021

Creating a Makefile for custom application with multiple C files (PetaLinux)

Hi all,

I wrote a program that sends packets between the board and the pc.

And it has several libraries and several C-code files.

What exactly should I do so that I do not get an error when building a project!

 

I followed this tutorial :

https://www.xilinx.com/support/answers/67189.html

but when I use this command

Petalinux-create -t apps  --template install --name myapp  --enable

The makefile file is deleted and I only have this file:

 

#!/bin/sh

echo "Hello PetaLinux World"

 

Does anyone have a more up-to-date reference?

0 Kudos
5 Replies
stephenm
Xilinx Employee
Xilinx Employee
365 Views
Registered: ‎09-12-2007

You are using the install template. Is this what you want? Are you trying to install prebuilt libraries and binaries into your roots. Are these cross compiled to execute on your target device?

 

0 Kudos
watari
Professor
Professor
326 Views
Registered: ‎06-16-2013

Hi @MrGorji 

 

What kind of error are you facing ?

 

BTW, would you try to build your application with Makefile on X86_64 linux, if possible ?

You might to be able to find the route cause...

 

Best regards,

0 Kudos
MrGorji
Observer
Observer
281 Views
Registered: ‎07-18-2021

thanks for replies @stephenm and @watari 

 

I have a custom board

And two files I want to add to petalinux (apps section in petalinux)

Similar to the lwip echo server program but with a slight change

And has a library and so on


Now my problem is attaching these two files to petalinux apps with libraries, and how to change the makefile!

 

The error I encounter:

Here are two programs I would like to add to Petalinux apps:

 


Thank you for your help

Screenshot (15).png
Screenshot (17).png
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
254 Views
Registered: ‎09-12-2007

Looks like you are trying to compile a baremeral application in linux. This will not work.

If you are just looking to send packets in an app, then you can just use a simple socket/client c code. There are plenty of examples online.

For testing, you can use the blog here

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Creating-a-Linux-user-application-in-Vitis-on-a-Zynq-UltraScale/ba-p/1141772

 

0 Kudos
MrGorji
Observer
Observer
221 Views
Registered: ‎07-18-2021

Another question @stephenm 

Can I run this simple socket / client code without using the SDK/Vitis?

If yes, how can I define libraries for petalinux ? 


My main question is whether it is possible to run code with multiple libraries and resources without using SDK/Vitis in petalinux?

Do i need a BSP to define libraries, and what is a BSP for?

Sorry, I new in petalinux.


And now I'm very confused.

 

0001.JPG
0 Kudos