Ethernet MAC address

08 Nov 2010

Mbed team (Simon?)

On reading the LPC17xx user manual it states that SA0/1/2 registers are zeroed at reset (page 148). So, can you tell me how the Mbed library component Ethernet assigns a unique MAC address to these registers? tia.

08 Nov 2010 . Edited: 08 Nov 2010

Hi Andy,

It uses an underlying function called:

extern "C" void mbed_mac_address(char * mac);

which fills in a 6 character array; what this actually does is return a MAC address based on requesting the serial number of the mbed Interface.

I thought it'd be useful if each mbed had its own MAC address, so when I needed to serialise the mbed Interface I decided to kill two birds with one stone and bought a whole load of MAC addresses. These are part of the serial number, so every mbed is guaranteed a unique MAC address :)

Simon

btw, if you want to set your own MAC address, you can just reimplement mbed_mac_address() to return what you want. It is a weakly linked function.

08 Nov 2010

Ah, that's useful information. Any chance that can be put on the Ethernet doc page? I can imagine someone placing the LPC17xx into their own design only to find the Ethernet component doesn't work as expected. Thanks.