04-13-2021 02:45 AM - edited 04-13-2021 04:10 AM
I am using Vivado 2019.2 and Vitis 2020.2.
I have made a custom app for Linux which runs correctly through Vitis 2019.2 debug with TCF agent.
Now i want to put my app on SD card and run it automatically when i switch on zc702 evaluation kit.
I follow Petalinux guide:
So i can build system image.
Application Auto Run at Startup (page 123) of ug1144
I am able to include my app in Petalinux image, in different locations depending how i initialize: myapp-init.bb:
/usr/bin or /etc/init.d.
Following Guide, it will only go to /etc/init.d, but if i use autocreation for my app:
petalinux-create -t apps --template install -n myapp-init --enable
it will be installed in /usr/bin.
Lets assume i follow guide. I put my board switches in SD start method, copy BOOT.BIN, image.ub and boot.sc created with Petalinux in my SD
and switch on the board.
What i obtain is (at a point of the Log):
random: dd: uninitialized urandom read (512 bytes read)
Starting myapp-init <-- First line of my app
Configuring packages on first boot....
(This may take several minutes. Please do not power off the machine.)
Running postinst /etc/rpm-postinsts/100-sysvinit-inittab...
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
Removing any system startup links for run-postinsts ...
And afterwards, it accesses Petalinux console (user-pass..).
It seems that my app started, but was terminated as soon (was launched once and stopped).
I would like to keep App alive.
Some considerations to be done:
User manual App is onyl installed on:
It is strange that myapp-init first lines refer to:
As that, does not simply exist.
Because of it, i simply changed it with:
So that DAEMON executes an existing app.
If i cd /etc/init.d ./myapp-init
it will correctly launch server-app (altough printf will not be seen in my console, but that is not the main problema now).
So, why does my app configured to start at boot keep deactivating itself?
I have followed, additionally, this post (which marks ug1144 document as incorrect at that point):
But output is the same.
04-13-2021 05:43 AM
04-13-2021 05:43 AM
04-13-2021 08:50 AM
Thanks man! I have been blind for a while thinking my problem was i could not execute an app on boot, when problem was other one. My app configures a TCP server which stays listening in an specific IP. This static IP is specified with Petalinux tool:
Subsystem AUTO Hardware Settings->Ethernet Settings
Problem is boot order:
1- Petalinux boots and loads some config
2- My app starts
3- Petalinux loads ethernet config
This brought My app failing and terminating itself, as the IP i wanted was not configured yet.
I will look for an existing thread on regards of this issue, or start a new one.
The solution you provide is very welcome!
04-14-2021 03:09 AM
@Moldan You can change the initlevel in your bootscript.bb file. For example, in your case you want this to be run with a runlevel of 99 in initlevel 5:
INITSCRIPT_PARAMS = "start 99 5 . stop 20 0 1 6 ."
I have tested this real quick, and it works for me: