In the TCPNet documentation it says:
The MAC address is written to the ethernet controller registers when the controller is initialized - the function init_TcpNet() is called. For this reason the variable own_hw_adr[6] need to be set before the TcpNet system is initialized. The ethernet interface configuration parameters must be set after the TcpNet system has been initialized. The structure localm[0] may simply be overwritten with new values.
OK, but in Net_Config.c, localm (or nlocalm, actually) is defined as const, and therefore is located in FLASH and cannot be overwritten. This bug is not caught by the example code further down the same page of documentation because localm is overwritten using a mem_copy() function, whose call I suppose includes an invisible cast which removes the const.
Of course I can remove the const, but I wonder if I have missed something. For the MAC address everything is fine because own_hw_adr is not declared const.
Christopher Hicks
OK. I have sorted this out. I should be writing to localm[0] after all, and not nlocalm[0]. localm must be a symbol defined in the library, hence why I could not find it anywhere in the source code.