The MAC address is saved in the flash memory of the Computer on Modules.
The serial number and MAC address are almost the same thing: the MAC address has the first 3 bytes fixed
(Toradex OUI range): 00:14:2D:nn:nn:nn
The last 3 bytes represent the serial number found on the label (in hexadecimal).
Example:
Serial number on barcode sticker MAC address
002-0004380 -> 00:14:2D:00:11:1C
02226142 -> 00:14:2D:21:F7:DE
The following Microsoft Excel formulas may be used to compute a module's MAC address from a module's S/N (where cell A1 contains the S/N).
With colon delimiters (eg. 00:14:2D:78:90:AB):
="00:14:2D:"&MID(DEC2HEX(MOD(A1,100000000),6),1,2)&":"&MID(DEC2HEX(MOD(A1,100000000),6),3,2)&":"&MID(DEC2HEX(MOD(A1,100000000),6),5,2)
Without delimiters (eg. 00142D7890AB):
="00142D"&DEC2HEX(MOD(A1,100000000),6)
To get the MAC address from user space, you can use the ip
command:
root@colibri-imx6:~# ip link1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000link/ether 00:14:2d:4d:c7:30 brd ff:ff:ff:ff:ff:ff
In the example above, the MAC address for the Ethernet interface is 00:14:2d:4d:c7:30.
From within U-Boot proceed as follows:
U-Boot # setenv ethaddr 01:23:45:67:89:ab U-Boot # saveenv Saving Environment to MMC... Writing to MMC(0)... done
Some Toradex modules have a second RGMII/MII interface to connect another Ethernet controller. To config the second MAC address, use eth1addr
on U-Boot.
U-Boot # setenv eth1addr 01:23:45:67:89:ac U-Boot # saveenv Saving Environment to MMC... Writing to MMC(0)... done
You should be able to use the new MAC Address applied in Linux.
To reset the MAC address to factory default, from within U-Boot proceed as follows:
U-Boot # setenv ethaddr U-Boot # saveenv Saving Environment to MMC... Writing to MMC(0)... done U-Boot # reset resetting ... U-Boot 2011.06-00012-g658a595 (Jun 07 2013 - 20:27:55) TEGRA3 DRAM: 1 GiB MMC: Tegra2 SD/MMC: 0, Tegra2 SD/MMC: 1 mmc_reset: power control = 0F, host control = 00 Board: Toradex Colibri T30 Writing to MMC(0)... done Net: Net Initialization Skipped No ethernet found. Hit any key to stop autoboot: 0
To reset the complete environment to factory defaults, from within U-Boot proceed as follows:
Tegra3 # env default -a ## Resetting to default environment Tegra3 # saveenv Saving Environment to MMC... Writing to MMC(0)... done Tegra3 # reset resetting ... U-Boot 2011.06-00012-g658a595 (Jun 07 2013 - 20:27:55) TEGRA3 DRAM: 1 GiB MMC: Tegra2 SD/MMC: 0, Tegra2 SD/MMC: 1 mmc_reset: power control = 0F, host control = 00 Board: Toradex Colibri T30 Writing to MMC(0)... done Net: Net Initialization Skipped No ethernet found. Hit any key to stop autoboot: 0
The "Writing to MMC(0)... done" indicates that it did successfully store it in the U-Boot environment.
If you get the following message it means your module has a corrupted factory configuration block:
Missing Colibri config block
To reconstruct the configuration block use the command 'cfgblock create' from the U-Boot command line.
Refer to the module specific flashing instructions for details: i.MX 6, Tegra, Vybrid
If your company has its own MAC address range, you can change the MAC address. The easiest way to do this is to use the bootloader. You can find the MAC in the bootloader menu in the section MAC.
Also the Colibri Tweak provides a function to change the Mac/Serial Number
See the SysInfoLib to know how to get the MAC address inside a program.