My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company
You are welcome to contact me
and ask questions or make comments
about my blog.
We need to establish an ethernet connection between our development host and the development board. Among other things we will use this connection to:
1. Access the web sever running in the PetaLinux installation. 2. Doing netboot.
Here is what the physical connection looks like. I have added an ethernet switch and connected one patch cable between the ethernet connector on the ZedBoard to one of the switch ports. The other patch cable is connected to the ethernet port on the host computer and then to one of the free switch ports. As you can see I am using a MacBook Pro with a native ethernet port. If I get this setup to work I will try the MacBook Air with the external USB to ethernet adapter later on.
We will run this setup as a stand-alone network, not relying on a local area network (LAN).
This was the easy part now we are ready for the more complicated software setup.
Fixing the ethernet port
We will setup a static IP address for the built-in ethernet port (en0). On the Mac open the system settings and select Network. Change to manually configure IPv4 and set the IP address to: 192.168.33.1
Open a terminal and enter the command ifconfig:
Checking the connection between the computer and the ZedBoard
We will set the IP Address of the ZedBoard to 192.168.33.2 (same subnet) using the command:
ifconfig eth0 192.168.33.2
Now let's try to ping the ZedBoard from the MacBook.
We have setup a working ethernet connection between our host and the ZedBoard.
Accessing the PetaLinux web server
PetaLinux is running a full web server in their Linux installation. To access it we just have to enter the IP address in our favorite web browser.
Let's try some of the menu alternatives. Here is the Admin page.
Establish an ethernet connection between host and guest
Now we have to figure out how to connect to our guest OS (Ubuntu 64bit) from our host (Mac OS) and vice versa. So far we have connected to our virtual machine using NAT.
This will allow the guest system to access the broader internet through our host’s connection. We wll be able to download packages, check email; whatever. Nobody outside sees anything of our guest system; as far as they’re concerned, it doesn’t exist. However, we cannot access any guest resources from our host machine, nor can any guest machines access each other.
We’ll need to add another network adapter to our guest machine, but this time, it’ll be a Host-Only Adapter. By using this type of adapter, we’ll be able to access a private, virtual network consisting solely of our host and any guests. Any of the member machines can access each other, but nothing outside of this self-contained “network in a box” can get in. We will shutdown our guest OS and add a host-only network adapter.
1. Select Preferences from the VirtualBox top menu. 2. In the preference pane select Network.
3. Select Host-only Networks and then the add icon (+). The vboxnet0 will be added. 4. Click the edit icon (the bottom one). 5. Take note of the IP address. That’s the address at which our guests can access the host. 6. The IP address 192.168.0.0 is the start of the Class C private range. By convention, network routers and other gateways use 192.168.0.0 to reference a private network generically.
7. Select DHCP Server.
8. By default, there’s a DHCP server set up on the network. Since we’re going to be assigning static IP addresses, we don’t really need this, so we can uncheck the “Enable Server” box on the DHCP configuration panel. 9. Click OK 10. We will create a new network adapter (Adapter 2) and attach it to host-only adapter.
11. We are ready to boot our guest OS (Ubuntu). 12. We now have two "ethernet cards" , eth0 and eth1 in our guest OS.
Configure the guest
We need each of the guests to have a static IP address on the host-only network. Log in to our Ubuntu guest and issue the following command:
sudo ifconfig eth1 192.168.56.101 netmask 255.255.255.0 up Set guest IP address permanent
If we set the IP address using the ifconfig command it is just temporary. When we reboot Ubuntu this configuration will disappear. To make it permanent follow this steps:
1. From the Ubuntu menu select System Settings->Network.
2. Select the wired network matching eth1. Check the MAC address to find out which one it is. Enable it and click the Options button.
3. Select IPv4 settings. Choose Manual method and specify the IP address, netmask, and gateway. Click Save.
Here is the command to login from the Mac OS X host. Don't forget to include the guest's username before the IP address.
Remote login from guest to host
Here is the command to login from the Ubuntu guest. Don't forget to include the host's username before the IP address.
We now have established an ethernet connection between the host and the guest and between the host and the ZedBoard. This will allow us to communicate and transfer data to/from all three nodes in our system.
My computer and zedboard can ping each other successfully, but my computer cannot @ my zedboard. It says connection refused. I use petalinux 2014.2.
GMA August 9, 2014 12:07 PM PDT
what if we need to set Ethernet on Zedboard, but with standalone application, in order to make a connection with Pc or other device which have ethernet connection, my goal is to send xml file from zedboard to the other device via Ethernet, but with standalone application ?