This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TCPNet: Runtime IP configuration

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