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.

Changing/Assigning MAC address

Other Parts Discussed in Thread: OMAPL138

Hi All,

I have been using evm 6678 for network programming. I just modified the hua demo in order to initialize the ethernet and then developed my socket application. However, I would like to change the MAC address of the PHY in order to get MAC address from a different source rather than the one hardcoded in EVM. I think EVM has a MAC address burned in factory which can be got by CSL_BootCfgGetMacIdentifier function inside the EMACInit_Core function. What I want to do is just assign a different MAC address. I searched for a possible solution like;

* Writing the new MAC address to MACADDRLO and MACADDRHI registers. (If I am right what should I do after writing the MAC value? Just writing it is enough or not?)

* By using NIMUIoctl function in stkmain.h.

Would you please suggest a method in order to assign a different MAC? If the ones above possible, would you please elaborate the procedure?

Regards

 

EVM 6678

NDK 2.20.04.26

  • Hi Deniz Kocak,

    There is an example of how to do this in the evmOMAPL138 hello world example (this is an NDK example).

    What the example does is, based on a #define, it either reads the MAC address from FLASH, else it uses one that's defined in the project.

    Please see the file "emacHooks.c" in the attached.  Look for the "#ifdef BSL" and corresponding "#endif" for the MAC address code.

    Steve

    0753.ndk_evm6748_bios6_helloWorld.zip

  • Hi Steven,

    Thanks for your reply. However, I could not understand the way I should follow. The example you refer is based in OMAPL138 and I saw differences between its driver level code and pdk 6678 code. Let me explain;

    In the example you sent, implementing EMAC_getConfig is enough I think. But I could not understand one thing.

    NC_NetStart triggers the NIMUInit which are defined in NDK source code. Then NIMUInit calls EMAC_Init which query the MAC address and set it. However in different file there are differences.

    \nsp_1_00_00_09\packages\ti\drv\omapl138\nimu_eth.c 

    In this file EMacInit calls HwPktInit() which is defined in ethdriver.c file. Inside the HwPktInit() function the method EMAC_getConfig(bMacAddr) is called as you suggest to put MAC address in it.It's OK.

    However in pdk...

    pdk_C6678_1_0_0_16\packages\ti\transport\ndk\nimu\src\nimu_eth.c

    EmacInit  calls  EMACInit_Core and unfortunately I could not see a similar callback mechanism to overwrite the MAC address. No HwPktInit defines/called here. Therefore no EMAC_getConfig or something similar. It just call platform_get_emac_info (i, &emac_info); and read the MAC address from evm, then set it. What can I do here?

     

    May be I missed something while reading documentation/code. Would you elaborate your answer?

     

    Regards