This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK - changing MAC without NIMU

How could I change MAC address of network interface without using NIMU API - i.e. using NDK 1.92 or 1.93 which has no NIMU?

Is it possible to change MAC during stack initialization or it has to be done inside HAL driver (driver is not NIMU-based)?

Shoud I modify netctrl.lib/netctrl.c supplying MAC to NC_NetStart() and EtherConfig()?

  // Create an Ethernet Device for each physical device

  for(i=0; i<EtherDeviceCount; i++)

  {

  // Create the Ethernet object. Note the physical index

  // is "1" based.

  hEther[i] = EtherNew(i+1);

 

  // We must configure the Ethernet device. This is so

  // we can handle non-standard devices.

  if( hEther[i] )

  EtherConfig( hEther[i], 1518, 14, 0, 6, 12, 4, NULL);

  }

Edit: I see MAC is set inside EMAC_64LC_getConfig(). That's satisfying me - probably I will not need to change MAC at runtime.

Edit 2: 'Delete message' option would be usefull.

  • On most implementations the MAC address is stored on a non-volatile memory either embedded in the Ethernet PHY or external EEPROM, is and uniquely assigned to the board as part of the manufacturing process. So normally one does not need to change MAC address "on the fly" and changing to another MAC address in use will cause a network conflict within the subnet.

    Ethernet PHYs or EEPROM usually allows a mechanism to initialize the MAC address via I2C or memory mapped registers. TI EVMs usually come with low level test code called Board Support Package that contains example code on how MAC address can be set for that implementation.