How to change MAC Id in FreeRTOS-plus-TCP in run-time

Hello, I am doing a Ethernet project which uses FreeRTOS-Plus-TCP library for embedding TCP/IP stack. We require to program the MAC id into the MCU at run-time only once instead of writing the MAC id in Smart configurator every time.
Does FreeRTOS-Plus-TCP provide an API to change the MAC Id of Ethernet peripheral.

There is no such thing as a “smart configurator” in FreeRTOS, that must be part of your eco system.

The location of the MAC address of your device can and will vary depending on your hardware. I have seen MAC addresses is EEPROM, Flash, on USB sticks (not recommended) and every other imagineable form of non volatile memory. A rather natural location is OTP flash supported by a number of Cortex PODs.

The only requirement really is that each of your devices has a way to retrieve its own unique MAC address from whichever form of non volatile memory and use it to configure FreeRTOS+TCP at system startup (which will propagate it to PHY). Assigning and storing that address is typically part of the manufacturing process.

1 Like

Hi Raghav,

Yeah as @RAc mentioned once the MAC address is known you can use the FreeRTOS_FillEndPoint API to set the mac address once, followed by FreeRTOS_IPInit_Multi.

1 Like

FreeRTOS-Plus-TCP library does not offer a dedicated API for changing the MAC ID of the Ethernet peripheral at run-time. Typically, the MAC ID is configured during initialization and remains static. However, you might explore direct manipulation of Ethernet controller registers or implement a custom solution to read the MAC ID from non-volatile memory during runtime initialization. Nonetheless, modifying the MAC ID at runtime can impact network connectivity and requires careful consideration and testing.