This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Runtime Configuration of MAC Address

Hi,
I'm using RL-NET 6.4, I wanted to change MAC address of my boards dynamically, there is this evidence in documentations.


The MAC address is written to the Ethernet controller registers when the controller initializes (when calling the function net_initialize). For this reason, ETH_CFG.MacAdr must be set before the system initializes.

But it seems that there is no ETH_CFG.MacAdr variable,
So the question is am I missing something? How should I change the MAC address dynamically?

Regards

Parents Reply Children
  • Thanks for the info,
    But the code complains about
    main.c(18): error: #70: incomplete type is not allowed

    this is my code

    
    extern struct ETH_CFG eth0_config;
    
    uint8_t mac_adr[6] = { 0,1,2,50,60,70 };
    
    int main(void)
    {
    
    
            memcpy (eth0_config.MacAddr, mac_adr, 6);
            // Initialize the Network Core
            net_initialize ();
            while(1)
            {
            }
    }
    
    

  • And your next step then was to scan through all header files, checking if any header file contained ETH_CFG?

  • Thanks for the info, Actually I have found it on #include "rl_net_lib.h"

    But no matter if I include it in my main code,I still got the same error,

    Also if I include #include <net_config.h> the code generates another error


    C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\6.4.0\Network\Include\net_config.h(27): error: #35: #error directive: "::Network:Interface: No interface enabled in configuration" #error "::Network:Interface: No interface enabled in configuration"

    I do not real not know what am I doing wrong.