MAC address (CRC hardware) filter is all zero and promiscuous mode bit is zero, but still receiving Ethernet messages...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MAC address (CRC hardware) filter is all zero and promiscuous mode bit is zero, but still receiving Ethernet messages...

Jump to solution
1,013 Views
rickstuart
Contributor V

Hi,

I have a project where I want to receive Ethernet message for 2 different MAC addresses.  I have code that receives a MAC that I have assigned to the Ethernet-port/RTCS stack.  I can see these messages in the receive-Ethernet-message-call-backs I have set up.  Now I want to also receive a 2nd set of Ethernet messages with a different MAC address.  I want both MAC address to make it back to my receive-Ethernet-message-call-back function.

Question: What is the easiest way of doing this?

I thought the easiest way was to open up the MAC hardware filter on the Freescale processor.  But, I inspected the ENET_IAUR, ENET_IALR, ENET_GAUR and ENET_GALR registers using the debugger and see that they are all zero!  So, I assumed promiscuous mode was enabled.  So I inspected ENET_RCR-PROM and see that that bit is 0.  That is, promiscuous mode is disabled!

Question: How is this possible to receive any Ethernet messages if all the hardware MAC filters are set to block all messages?

My code is running and I can receive Ethernet messages with the MAC I have used to configure my code thus far.  And I have check alternative MAC address and do not see them.  So there is filtering going on somewhere.

Question: Where does MQX filter the inbound MAC addresses?

-thanks

0 Kudos
1 Solution
535 Views
dereksnell
NXP Employee
NXP Employee

Hi Rick,

The MQX Ethernet example applications use the ENET driver function ENET_initialize() to pass the MAC address to the ENET driver. That function will then write the MAC address to the Ethernet MAC peripheral registers. If you step through that function, you will find the registers ENET_PALR and ENET_PAUR are set to the MAC address argument.

You can refer to the section “MAC Address Check” in the Kinetis device reference manual in the ENET peripheral chapter for the details on how the MAC address filtering works in the ENET. But for unicast address matches, these Physical Address registers are used for filtering, and that is how the MQX examples work. The ENET Individual address and group address registers that you reference are used for hash table matching, and are not used in the MQX examples, which is why those registers remain set to 0.

To prevent the MAC from filtering received unicast messages for two MAC addresses, you can enable promiscuous mode using ENET_RCR[PROM]. This will disable all MAC address filtering, so software will be required to filter all frames. Also, the individual address hash table could be used to filter out most of the received frames that don’t match the desired two MAC addresses. There is an older appnote AN2745<http://cache.freescale.com/files/32bit/doc/app_note/AN2745.pdf> written about setting up hash tables. This appnote was not written for Kinetis, and uses a different Ethernet peripheral. So you should refer to the Kinetis reference manual for the specifics for the ENET peripheral. However, you may find the description of the hash tables and setup in this appnote useful.

Thanks

View solution in original post

0 Kudos
1 Reply
536 Views
dereksnell
NXP Employee
NXP Employee

Hi Rick,

The MQX Ethernet example applications use the ENET driver function ENET_initialize() to pass the MAC address to the ENET driver. That function will then write the MAC address to the Ethernet MAC peripheral registers. If you step through that function, you will find the registers ENET_PALR and ENET_PAUR are set to the MAC address argument.

You can refer to the section “MAC Address Check” in the Kinetis device reference manual in the ENET peripheral chapter for the details on how the MAC address filtering works in the ENET. But for unicast address matches, these Physical Address registers are used for filtering, and that is how the MQX examples work. The ENET Individual address and group address registers that you reference are used for hash table matching, and are not used in the MQX examples, which is why those registers remain set to 0.

To prevent the MAC from filtering received unicast messages for two MAC addresses, you can enable promiscuous mode using ENET_RCR[PROM]. This will disable all MAC address filtering, so software will be required to filter all frames. Also, the individual address hash table could be used to filter out most of the received frames that don’t match the desired two MAC addresses. There is an older appnote AN2745<http://cache.freescale.com/files/32bit/doc/app_note/AN2745.pdf> written about setting up hash tables. This appnote was not written for Kinetis, and uses a different Ethernet peripheral. So you should refer to the Kinetis reference manual for the specifics for the ENET peripheral. However, you may find the description of the hash tables and setup in this appnote useful.

Thanks

0 Kudos