cancel
Showing results for 
Search instead for 
Did you mean: 

I am working on Ethernet in STM32H745 MCU. How to assign a different MAC address to 100 MCU so that they can work together on LAN? Further how to filter ethernet packets having a particular MAC address?

Akast.2
Associate II

I am working on Ethernet in STM32H745 MCU and using STM32CubeIDE. I want to connect 100 such MCU to LAN.

How can I assign a different MAC address to all the MCU? Do STM MCUs have a built-in MAC that I can use, or is there any other method to assign different MAC to many MCUs?

Further, I want to filter out ethernet packets having a particular MAC address. What are the different methods available to apply such filters? Can these filters be applied on the PHY layer(LAN8742) or HAL or any other method?

3 REPLIES 3
Akast.2
Associate II

Dear ST Team,

I am blocked because of the issue, kindly help by providing a solution to the problem.

Waiting for the reply.

ST doesn't provide MAC addresses, these would need to be bought in blocks from the IEEE, or whatever the current issuing authority is,and you'd have to assign them to your individual devices.

As I recall the ETH MAC peripheral on the STM32's can filter based on a CRC32/HASH type mechanism, it's been a while since I looked. But it should be described in the RM for those who use such things.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II

For MAC addresses there are 3 options:

  1. For private usage one can use locally administered addresses. The simplest is to generate a CRC/hash from the device unique ID and just set the U/L bit. Of course, there is a small chance of a collision, but that is negligible.
  2. Add an EEPROM with a registered MAC address to the design.
  3. Register a MA-S (or bigger) range of MAC addresses and flash the assigned address to OPT or a special region of FLASH memory.

Except for monitoring the magic packet wake-up frames, PHY operates at L1 (physical) layer and doesn't process anything at L2 (MAC) layer. Generally you don't need any filtering at all, because the network switches already send only the frames destined to your MAC address and a broadcast/multicast frames. Read my posts in this topic:

https://community.st.com/s/question/0D50X0000BNu2BFSQZ/ethernet-performance-packets-loss