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??