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.

D3-3P-TDA3X-SK: DHCP Discover MAC source address is zero

Part Number: D3-3P-TDA3X-SK

Hi,

We have a setup on the TDA3XX-RVP board using NDK 4.16.01.01 with dual MAC enabled, running only on the second MAC (i.e. using PORT_MASK_MAC_2 in the GMACSW configuration) and enabling the DHCP client on the corresponding interface (interface 2). This seems to cause the NDK to emit DHCP Discover messages where the source ethernet MAC address is all-zero, which is a problem.

After some investigation we have concluded that the issue is probably the following piece of code in NIMU_NDK_start (nimu_ndk.c), which incorrectly copies the MAC address from MAC port 0 to all NETIF devices (even those that use MAC port 1):

mmCopy(&pNETIFDevice->mac_address[0], &hNDK2NSP->bMacAddr[0], (uint)6U);

Here, pNETIFDevice->mac_address is an uint8_t[6] while hNDK2NSP->bMacAddr is an uint8_t[2][6]. We believe the correct code would instead be the following:

mmCopy(&pNETIFDevice->mac_address[0], &hNDK2NSP->bMacAddr[devIdx][0], (uint)6U);

This would correctly copy the MAC address from MAC port 1 to the NETIF device corresponding to interface 2.

We have a workaround, which consists of using PORT_MASK_MAC_BOTH in the GMACSW configuration and copying the same (correct) MAC address to both macInitCfg entries in this configuration. Are there any immediate drawbacks of using such a workaround? We would prefer not having to patch the NDK ourselves.

Regards,
Simon