News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Ethernet ZynqBerry TE0726: static ip address

Started by sebo, December 05, 2016, 10:35:11 PM

Previous topic - Next topic

sebo

Hello,

How to setup the config in petalinux for a static ip address?
With petalinux 2016.2, the menu Subsystem AUTO Hardware Settings->Ethernet Settings does not provide these options.
I only have: primary ethernet (manual)...

thanks.

S/

Oleksandr Kiyenko

Hello,

to set static IP address in petalinux you need to replace /etc/network/interfaces with your own

it should contain something like this


auto lo
iface lo inet loopback

auto eth0
    iface eth0 inet static
        address 192.0.2.7
        netmask 255.255.255.0
        gateway 192.0.2.254


to do that create petalinux app

petalinux-create -t apps -n static --enable
rm components/apps/static/static.c


then create your interfaces file components/apps/static/interfaces
and modify components/apps/static/Makefile
change
all: build install
to
all: install
remove build section and change install to
install:
    $(TARGETINST) -d interfaces /etc/network/interfaces


Best regards
Oleksandr Kiyenko

sebo

Many thanks Oleksandr.
It works perfectly.

BR,

S.

sebo

Hi,

This is working to setup the ip address in petalinux. What if I want to use TFTP during the boot?
IWhen I stop the boot process, and try to boot in tftp, I get --> no ethernet found.

Thanks.

Oleksandr Kiyenko

#4
Hi Sebo,

For TFTP boot you need to configure server IP, you can do it in petalinux-config
"u-boot Configuration->TFTP Server IP address"
or in u-boot configuration file
#define CONFIG_SERVERIP 192.168.42.3

To use that to use ZynqBerry Ethernet u-boot should have USB support and driver for SMSC95xx. In general U-Boot support USB Networking but we did't try it on u-boot included in petalinux.

Best regards
Oleksandr Kiyenko

sebo

#5
There is no such configuration in petalinux-config...
When I go in u-boot Configuration, I get no choice than:
│  Use the arrow keys to navigate this window or press the      │ 
│  hotkey of the item you wish to select followed by the <SPACE │ 
│  BAR>. Press <?> for additional information about this        │ 
│ ┌───────────────────────────────────────────────────────────┐ │ 
│ │                (X) PetaLinux u-boot config                │ │ 
│ │                ( ) other                                  │ │ 
│ │                               


When I look for CONFIG_SERVERIP in /subsystems/linux/configs/u-boot/config: No luck.. Same in the platform-auto.h
I need to tell I'm starting from te0726_demo1.

If I create a new petalinux project and I do not import the hdf description, there are information related to ps7_ethernet_0 that are deleted after HW import:

/* ethernet - ps7_ethernet_0 */
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
#define CONFIG_SYS_ENET
#define CONFIG_MII
#define CONFIG_PHY_GIGE
#define CONFIG_PHY_MARVELL
#define CONFIG_PHY_NATSEMI
#define CONFIG_NET_MULTI
#define CONFIG_CMD_DHCP
#define CONFIG_BOOTP_MAY_FAIL
#define CONFIG_NETCONSOLE 1
#define CONFIG_SERVERIP 172.19.74.38
#define CONFIG_IPADDR



Thanks.

Oleksandr Kiyenko

Hi Sebo,

Sorry, "(AUTO) TFTP Server IP address" option is in Petalinux 2016.3. You have to add CONFIG_SERVERIP to platform-top.h
there should be also

#define CONFIG_CMD_USB
#define CONFIG_USB_UHCI
#define CONFIG_USB_HOST_ETHER

but in petalinux version of u-boot it cause build error
recipe for target 'common/cmd_usb.o' failed
possibly u-boot can be patched but I am not 100% sure that it have Zynq USB host driver.


Best regards
Oleksandr Kiyenko