Main Site Documentation

Setting a persistent G120E EthernetBuiltIn MAC address


#1

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.


#2

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


#3

@ 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?


#4

I would look for an API to access device configuration?


#5

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.


#6

@ 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.


#7

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

Thanks, @ Mike! :clap:


#8

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

Jay