Setting a persistent G120E EthernetBuiltIn MAC address

How can I change the G120E EthernetBuiltIn MAC address from my application program and have it persist across boot cycles and power cycles? I know that FEZ Config will program the MAC semi-permanently, however I need to do this from my application.

I have tried setting the PhysicalAddress in both the BaseInterface and NetworkInterface objects, and either will set the MAC for the session but it will not persist across a boot cycle, much less a power cycle. :frowning:

I have found the Processor.Configuration(“NETWORK”) entry which contains the addresses in the byte stream, but making the modification this way seems like a hack. Is there a better way? ???

Thanks for any help.

@ PBgrammer - Use the FEZ Config program that comes with the GHI SDK. It will make it persistent.

@ Mike - Thanks, but as I stated above FEZ Config is not an option. I need to set the MAC from my application.

Any other ideas?

I would look for an API to access device configuration?

I found the GHI.Processor.Configuration class that exposes the configuration information, and specifically the “NETWORK” entry that holds the MAC addresses for the 4 supported interfaces. Unfortunately the byte stream returned appears to be some form of serialized class data. So even though I have reverse-engineered the exact bytes in the “NETWORK” configuration that hold the MAC address I want to update, those byte positions could easily change with a future release of GHI’s SDK and my application would cease to function.

That’s as close as I can get to an API to change the config.

@ PBgrammer - I believe that there is a user area in the configuration. Use it to store the mac and set it at initialization. Write your own entry.

Oh, yeah, of course! Why didn’t I think of that? :-[

Thanks, @ Mike! :clap:

Here you are :slight_smile:
https://www.ghielectronics.com/community/codeshare/entry/822

Jay

1 Like