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.

TMS320C6745: NDK Ethernet Mac Address

Part Number: TMS320C6745

Using pdk 1_0_10

The library provided use this to obtain the MAC address for NDK.

int32_t nimu_get_emac_info(uint32_t port_num, NIMU_EMAC_EXT_info * emac_info)
{
uint32_t mac_addr2, mac_addr1;

emac_info->port_num = port_num;

emac_info->mode = 1;

mac_addr1 =0x02030415;
mac_addr2 = 0x0001;
emac_info->mac_address[0] = ((mac_addr2 & 0x0000ff00) >> 8);
emac_info->mac_address[1] = (mac_addr2 & 0x000000ff);

emac_info->mac_address[2] = ((mac_addr1 & 0xff000000) >> 24);
emac_info->mac_address[3] = ((mac_addr1 & 0x00ff0000) >> 16);
emac_info->mac_address[4] = ((mac_addr1 & 0x0000ff00) >> 8);
emac_info->mac_address[5] = (mac_addr1 & 0x000000ff);

return 0;

}

This hardcoded version can't be used in real word, MAC address MUST be changed.

The subsequent instruction:

 ret_code = NIMUIoctl(NIMU_SET_DEVICE_MAC, &if_req, &mac_address, sizeof(mac_address));

fails saying that MAC address can't be changed at run-time.

 

Is to change the (precomplied) library the only ways to set a specific MAC address??

  • Another possibility;

    It is possible to override the

    int32_t nimu_get_emac_info(uint32_t port_num, NIMU_EMAC_EXT_info * emac_info) 

    with a custom function in the project?

    It is not a wak function so the linker gives:

    symbol "nimu_get_emac_info" redefined: first defined in "./Ethernet.obj"; redefined in "C:\ti\pdk_omapl137_1_0_10\packages\ti\transport\ndk\nimu\lib\omapl137\c674\release\ti.transport.ndk.nimu.ae674<nimu_eth.oe674>" null: symbol "nimu_get_emac_info" redefined: first defined in "./Ethernet.obj"; redefined in "C:\ti\pdk_omapl137_1_0_10\packages\ti\transport\ndk\nimu\lib\omapl137\c674\release\ti.transport.ndk.nimu.ae674<nimu_eth.oe674>"

  • Finally i modified the function nimu_get_emac_info in the pdk