Starting from your reference application I built an application that communicates with ABCC40 through SPI.
Everything work correctly and now I wondering how to specify the Ethernet Ports Mac Addresses.
My idea is to read the MAC Addresses from Host MCU flash memory and set it into the ABCC. In future I will buy a pool of MACs.
This is not the correct procedure. The Ethernet Host Object (F9h) belongs to the application and not to the module. So the module will send request to the application to get the information about the MAC addresses and the application must answer with the wanted values.
We have prepared a definitions for this configuration in the example code in the file “abcc_obj_cfg.h”, Which you can use:
** Attribute 9: Port 1 MAC Address (Array[6] of UINT8)
*/ #ifndef ETN_IA_PORT1_MAC_ADDRESS_ENABLE #define ETN_IA_PORT1_MAC_ADDRESS_ENABLE TRUE #define ETN_IA_PORT1_MAC_ADDRESS_VALUE “\x00\x30\x11\x00\x00\x01” #endif
/*
** Attribute 10: Port 2 MAC Address (Array[6] of UINT8)
*/ #ifndef ETN_IA_PORT2_MAC_ADDRESS_ENABLE #define ETN_IA_PORT2_MAC_ADDRESS_ENABLE TRUE #define ETN_IA_PORT2_MAC_ADDRESS_VALUE “\x00\x30\x11\x00\x00\x02” #endif
My goal is to configure the module MAC addresses reading this MACs from the MCU Flash Memory.
I thought that it is possible to set the MAC during the module initialization writing some objects.
I enabled the processing of ETN_ProcessCmdMsg and I can check that thise case in executed:
#if ETN_IA_MAC_ADDRESS_ENABLE
case ABP_ETN_IA_MAC_ADDRESS:
{
UINT16 i;
UINT8 abMac[ 6 ];
ANYBUS_CC_INTERFACE_GetMacAddress( abMac );
for( i = 0; i < ABP_ETN_IA_MAC_ADDRESS_DS; i++ )
{
ABCC_SetMsgData8( psNewMessage, abMac[ i ], i );
}
ABP_SetMsgResponse( psNewMessage, ABP_ETN_IA_MAC_ADDRESS_DS );
break;
}
#endif
and I added a function to respond with the MAC address.
I also noticed that the attributes 9 and 10 are never accessed.
This could be related to the fact that I use the ABCC as a network HUB and not as a device with two different ethernet ports?
Sorry for the misunderstanding. The change of the MAC address for the Port1 and 2 is only possible in the profint modules. It is unfortunately not possible for the Ethernet/IP module.
In the description of the Ethernet Host Object you can find the following statment:
Do not implement attributes #9 and #10, only used for PROFINET devices, if the module shall use the
preprogrammed MAC addresses.
Hi Federico,
Yes, this is the only way and the correct way to change the MAC address for Ethernet IP modules.
I’m not sure if there is a possibility by our side to produce the modules with specific MAC address for you.
If you are interested, please contact our sales team in your country and they will check the possibility.