cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Moldan
Observer
Observer
163 Views
Registered: ‎02-18-2021

Changing Petalinux elements Boot order to make Eth0 related App work

Jump to solution

I am working with Petalinux 2020.2

My objective is to Auto run an app loaded on an SD, which creates a TCP server and keeps listening in a defined IP (lets say 192.168.1.10) at zc702 evaluation kit boot.

In order to do that, i use Petalinux tools to change default IP adress of the board (so that my App and board keep in the same net) in:

petalinux-config

Subsystem AUTO Hardware Settings->Ethernet Settings

I assign 192.168.1.11(IP)/255.255.255.0(netmask).

Then i copy petalinux image(with my App included in it, set to auto run) to my SD card, following:

Application Auto Run at Startup (page 123) of ug1144

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_2/ug1144-petalinux-tools-reference-guide.pdf

I configure board to boot from SD, switch it on, and it fails.

This happens because boot order goes this way:

  1. Some petalinux configurations is loaded
  2. My app is loaded
  3. Eth0 link gets up

At that point, i can only configure my app to keep listening at local IP 127.0.0.1 (as it is not related to Eth0, and gets loaded at boot start).

I would like to change that order to 1,3,2.

How could i do this?

-----------------

In the App file, i specified:

ifconfig 192.168.1.11 netmask 255.255.255.0

before app is launched and something funny happened, TCP server was successfully set in 192.168.1.10, but afterwards i can not connect to it. When i ping server it tells me that 'It is unreachable', but it states there is no packet loss.

Will investigate a bit more.

 

 

0 Kudos
1 Solution

Accepted Solutions
Moldan
Observer
Observer
92 Views
Registered: ‎02-18-2021

Well, seems that using

ifconfig 192.168.1.10 netmask 255.255.255.0

# Wait till eth0 link is ready

sleep 8

./my_app

In the .sh which runs my app seem to work, and set eth0 interface without boot config need.

Work flow was pretty much this:

Connect my board and Windows pc through ethernet cable.

Set my windows pc ethernet cable direction to 192.168.1.10/ 255.255.255.0

Config eth0 of Petalinux automatically in boot (before running my app, in the same .sh file) with:

ifconfig 192.168.1.10 netmask 255.255.255.0

sleep 8 -> Wait 8 secs till eth0 link gets ready (no need to wait to boot)

Launch my TCP server in 192.168.1.10:8888 (automatically in Petalinux boot)

As a fun fact, if you use:

ifconfig 192.168.1.10 netmask 255.255.255.0

command in the .app load stage, it will ignore the IP settings you declared for boot in petalinux-config.

 

 

View solution in original post

1 Reply
Moldan
Observer
Observer
93 Views
Registered: ‎02-18-2021

Well, seems that using

ifconfig 192.168.1.10 netmask 255.255.255.0

# Wait till eth0 link is ready

sleep 8

./my_app

In the .sh which runs my app seem to work, and set eth0 interface without boot config need.

Work flow was pretty much this:

Connect my board and Windows pc through ethernet cable.

Set my windows pc ethernet cable direction to 192.168.1.10/ 255.255.255.0

Config eth0 of Petalinux automatically in boot (before running my app, in the same .sh file) with:

ifconfig 192.168.1.10 netmask 255.255.255.0

sleep 8 -> Wait 8 secs till eth0 link gets ready (no need to wait to boot)

Launch my TCP server in 192.168.1.10:8888 (automatically in Petalinux boot)

As a fun fact, if you use:

ifconfig 192.168.1.10 netmask 255.255.255.0

command in the .app load stage, it will ignore the IP settings you declared for boot in petalinux-config.

 

 

View solution in original post