cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157A-DK1 static IP configuration

LZamp.1
Associate II

We have several STM32MP157A-DK1 used for an european project and we have several problem about the Ethernet network configuration. We have to change the IP address and we followed the ST wiki about network configuration using the “ip addr add……�?, but the edits are volatile and vanishes after the board reboot. We have not found other methods (like “/etc/network/interfaces/eth0 “) to edit network settings. Could we have a support on that configuration?

6 REPLIES 6
mleo
Senior II
LZamp.1
Associate II

Hello.

We have tried even this method, but the edits vanish after reboot.

Kind regards

Lorenzo

mleo
Senior II

I can't try muself at the moment, but according these articles it should be feasible:

https://wiki.debian.org/SystemdNetworkd

https://wiki.archlinux.org/index.php/Systemd-networkd#Wired_adapter_using_a_static_IP

BR,

Milan

LZamp.1
Associate II

Dear Milan,

we tried the configurations in the links, but it seems that systemd is not managing the network. After configuring, network logs are:

-- Logs begin at Sat 2019-03-02 23:24:55 UTC, end at Mon 2020-03-02 16:42:59 UTC. --
Mar 02 23:24:56 stm32mp1 systemd[1]: Starting udev Kernel Device Manager...
Mar 02 23:24:56 stm32mp1 systemd[1]: Started udev Kernel Device Manager.
Mar 02 16:40:47 stm32mp1 systemd-udevd[276]: link_config: autonegotiation is unset or enabled, the speed and duplex are not w
ritable.
Mar 02 16:40:47 stm32mp1 systemd-udevd[276]: [[0;1;39m[[0;1;31m[[0;1;39mlink_config: could not get ethtool features for eth0[
[0m
Mar 02 16:40:47 stm32mp1 systemd-udevd[276]: [[0;1;39m[[0;1;31m[[0;1;39mCould not set offload features of eth0: Device or res
ource busy[[0m
Mar 02 16:40:48 stm32mp1 systemd-udevd[281]: link_config: autonegotiation is unset or enabled, the speed and duplex are not w
ritable.
Mar 02 16:40:48 stm32mp1 systemd-udevd[279]: [[0;1;39m[[0;1;31m[[0;1;39mProcess '/usr/sbin/alsactl restore 0' failed with exi
t code 99.[[0m
Mar 02 16:40:48 stm32mp1 systemd[1]: Starting Network Service...
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: [[0;1;39m[[0;1;31m[[0;1;39m/etc/systemd/network/wireless.network:1: Unknown s
ection 'match'. Ignoring.[[0m
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: Enumeration completed
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: request_name_destroy_callback n_ref=1
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: usb0: Link is not managed by us
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: lo: Link is not managed by us
Mar 02 16:40:49 stm32mp1 systemd[1]: Started Network Service.
Mar 02 16:40:49 stm32mp1 systemd-networkd[307]: lo: Configured
Mar 02 16:40:50 stm32mp1 systemd-udevd[369]: link_config: autonegotiation is unset or enabled, the speed and duplex are not w
ritable.
Mar 02 16:40:58 stm32mp1 systemd[1]: Stopping Network Service...
Mar 02 16:40:58 stm32mp1 systemd[1]: Stopped Network Service.
Mar 02 16:40:58 stm32mp1 systemd[1]: Starting Network Service...
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: [[0;1;39m[[0;1;31m[[0;1;39m/etc/systemd/network/wireless.network:1: Unknown s
ection 'match'. Ignoring.[[0m
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: Enumeration completed
Mar 02 16:40:59 stm32mp1 systemd[1]: Started Network Service.
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: eth0: Link is not managed by us
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: lo: Link is not managed by us
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: request_name_destroy_callback n_ref=1
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: lo: Link is not managed by us
Mar 02 16:40:59 stm32mp1 systemd-networkd[596]: lo: Configured

KR

Lorenzo Zampetti

CPRIO
Associate II

Hello Lorenzo,

As you can see on the previous log, there is a syntax error on your network file: /etc/systemd/network/wireless.network

The section must be declared under bracket and the first letter of section must be on uppercase.

For more description and example of syntax, you can refer to this internet help: https://wiki.archlinux.org/index.php/Systemd-networkd

Regards

Christophe

Otto
Associate

Hello Lorenzo,

did you finally manage to solve the Ethernet network configuration problem? No offence but concerning Christophe's response on the log you posted, configuring the wireless LAN interface seems out of scope of your initial problem and also does not seem to cause any fatal condition since systemd-networkd states that ignores it. It is also pretty obvious that systemd-networkd does not manage link layer, though you are interested about the network layer, correct?

I assume that you manage to get the wired interface connected to the network, but your static IP configuration is not taken into account by systemd-networkd. If so it seems like configuration found under /lib/systemd/network takes precedence over your configuration under /etc/systemd/network or/and systemd-networkd ignores your configuration due to bad naming or/and configuration syntax.

Please execute the following commands to validate my assumption:

$ systemctl stop systemd-networkd.socket
$ systemctl stop systemd-networkd.service
$ SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd

Look for the line containing: "eth0: found matching network 'path-filename of the file found' ". If you use the default root FS ST provides, this file should be : '/lib/systemd/network/50-wired.network'; or anyway it should not be the one you really wanted to or even you may not find any such line meaning no configuration life used for eth0. Press CTRL-C to exit.

If my assumption validates, there are two options (say configuration file contents are corrent) in order to properly configure your wired interface with static IP (I hypothesize that the system's default file found when you executed '$ SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd' was /lib/systemd/network/50-wired.network):

  1. rename /lib/systemd/network/50-wired.network to /lib/systemd/network/50-wired.network.notused. Do not forget that your file should always have '.network' as postfix
  2. add '49-' (or a number <=50) prefix to your configuration file under /etc/systemd/network to take precedence over system's default. Do not forget that your file should always have '.network' as postfix

Execute SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd to validate.

Wrap up.:

Proper configuration file name:

/etc/systemd/network/49-wired.network

Proper minimum configuration file contents (network used in example is 10.0.2.x, desired IP 10.0.2.200, network mask 24bit, gateway IP 10.0.2.1, net IF eth0)

[Match]
Name=eth0
 
[Network]
Address=10.0.2.200/24
Gateway=10.0.2.1

Folder /lib/systemd/network/ should not contain any enabled (postfix .network determines that) wired IF configuration files with prefix lower than yours

Hope this helps.

Regards,

Otto

ISCA-lab