This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

BeagleBoard xm fixed MAC address

The BeagleBoard xm has no fixed MAC address. During startup, a random MAC address is created and used. This is a problem if you wanna use it in your local LAN with Firewalls. It also is a problem to assign a fixed IP to the board, because the MAC address changes.

I searched and tried a lot of things to set a fixed MAC address. All hints didn't work:

Set an udev rule to assign a fixed MAC address
or configure eth0 with a fixed hwaddress

Well, to get a fixed MAC address I had to patch my image :( but how? I built my Angstrom image from scratch but all sources were downloaded as archives and bitbaker extracts/compiles the sources automatically. I found no documentation for manuall patching. And I didn't know what I should patch.

So I started researching. The network module was smsc95xx but I had no idea which version was used for the kernel. I had to find out the version before I could search a patch...

I knew that the file was stored in a directory with the name drivers/net/usb. All source archives are available in <dir>/setup-scripts/sources/downloads. An archive search should find the right archive but I had to find the build file for the kernel...

After some hours googling I found that <dir>/setup-scripts/sources/meta-ti/recipes-kernel/linux contains kernel buildfiles, but more than one! I figured out that linux-mainline_3.2.bb was the right buildfile. I checked the content and found the link to the source archive (online). After reading the source file I knew that the following patch should work: MAC address patch. Some details about this patch are available here.

I had a patch file and knew the buildfile but how should I apply the patch? It was not too complex because the buildfile already contained a list of patchfiles. I added my patchfile to the list and copied it to the same directory where all other patchfiles were stored.

The next step was the rebuild of my image... Sounds simple but how? It was simple with following commands:

bitbake -c clean virtual/kernel
bitbake virtual/kernel
bitbake systemd-gnome-image

Some hours later, I had a new kernel and recreated my SD card. To set a MAC address, I changed uEnv.txt:

optargs="consoleblank=0 smsc95xx.macaddr=xx:xx:xx:xx:xx:xx"

It works!

16 Responses to “BeagleBoard xm fixed MAC address”

  1. So is this not similar to setting an environment variable in U-Boot? Was the Kernel compilation necessary? I am trying to load a kernel image over tftp from U-Boot and am facing a problem of not having a MAC address at all!

    Reading your post I discover that BeagleBoard-xM does not come with a fixed MAC address.

  2. rjahn says:

    I tried setting an environment variable, but it didn't work. I tried a lot of options/parameters and tips from other users, but nothing worked.
    The only solution, for me, was kernel recompilation.

    Right, Beagleboard-xm does not have a fixed MAC address (no eeprom to store it).

    If you need a pre-compiled image with mac-address-patch, it is available here.

  3. This is what I just did -

    1. Interrupted the U-Boot
    2. env set usbethaddr 0E:60:A1:C9:46:01
    3. usb start or usb reset
    4. dhcp 0x82000000 192.1.1.254:uImage-BBone

    and the BeagleBoard-xM was able to download the kernel image. I think what worked was setting the `usbethaddr` before `usb start`.

  4. rjahn says:

    Oh, you're using an USB adapter.

    The patch was for the onboard NIC.

  5. The on-board NIC of the BeagleBoard-xM is connected to the onBoard USB hub. Once I set the MAC in U-Boot, the same MAC is assumed by the Kernel when it boots.

  6. rjahn says:

    OK, thanks for sharing your solution.

  7. desto says:

    Worked for me! Thanks a Million!

  8. Victor says:

    The pre-compiled image doesnt contain the kernel, do i have to compile it?

  9. rjahn says:

    The kernel is included!
    The archive contains everything to create a bootable media.

  10. Wolf Walter says:

    Hi,
    had the same problem. I tried your solution but that didn't work for me. I fixed it with udev inspired by http://archlinuxarm.org/forum/viewtopic.php?f=28&t=3133.

    I added /etc/udev/rules.d/99-mac-address.rules with the following content:
    SUBSYSTEM=="net", KERNEL=="eth0", RUN+="/bin/ip link set dev %k address xx:xx:xx:xx:xx:xx" RUN+="/etc/init.d/networking restart"

  11. rjahn says:

    Strange... I found the same link but it didn't work for me.

    Good to hear that it works for you, and thanks for posting the solution. It will be helpful for other users!

  12. Archith says:

    Great solution. Do you know which branch/git tag of angstrom this worked with for you? I am the angstrom branch 'angstrom-v2013.06-yocto1.4' and I cant find the file smsc95xx.c to apply the patch on.

  13. Archith says:

    On carefully reading your post, it looks like I dont need to directly modify the file smsc95xx.c, but pushing the patch in the correct directory should do the job. I have tried placing the file in the path which looks relevant to the Linux version running on the board but cant really locate the buildfile. Can you please point to where you found the buildfile in your setup?

    Thanks,
    Archtih

  14. rjahn says:

    Oh, sorry for my late answer... Simply forgot. I didn't use a specific branch. Simply used the current version... I have to check the exact version.

  15. rjahn says:

    Yep, give me some hours to check this.

  16. rjahn says:

    I used the source version of November 12, 2012 (version shows: v2012.05)

    Simply add the patch file to the existing patch list in: <dir>/setup-scripts/sources/meta-ti/recipes-kernel/linux/linux-mainline_3.2.bb. There are some other patches, simply copy one line and replace the filename. Be sure that your file is stored in the right directory!

Leave a Reply

Spam protection by WP Captcha-Free