cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable Ethernet MAC source address replacement?

ADunc.1
Senior

On STM32H753, is it possible to disable Ethernet MAC source address replacement?

I am working on a project that requires packet bridging, and I am stuck by the MAC altering the source address of bridged packets!

Reference manual section 58.5.2 discusses source address insertion/replacement.  It refers to register MACCR, bits SARC.  But the definition for these bits does not have an option to disable the MAC from overwriting the source address in my packets.

 

Edit:  I tried setting SARC bits to all zero and it seems to disable address replacement.  But this is not documented.  It appears bit 28 selects insert/replace, bit 30 selects address 0/1 and bit 29 enables/disables address insertion.  Does anybody have arms into ST to confirm if this is indeed the case?

 

Edit:  STM32H7 HAL driver for Ethernet seems to offer a disable option for source MAC replacement, so maybe it is a thing.  

/** @defgroup ETH_Source_Addr_Control ETH Source Addr Control
  * @{
  */
#define ETH_SOURCEADDRESS_DISABLE           0x00000000U
#define ETH_SOURCEADDRESS_INSERT_ADDR0      ETH_MACCR_SARC_INSADDR0
#define ETH_SOURCEADDRESS_INSERT_ADDR1      ETH_MACCR_SARC_INSADDR1
#define ETH_SOURCEADDRESS_REPLACE_ADDR0     ETH_MACCR_SARC_REPADDR0
#define ETH_SOURCEADDRESS_REPLACE_ADDR1     ETH_MACCR_SARC_REPADDR1
/**
1 REPLY 1
ASEHST
ST Employee

Hello @ADunc.1,

Thank you for bringing this to our attention.

As you correctly pointed out, you can use the ETH_SOURCEADDRESS_DISABLE address defined in the HAL driver to potentially disable the source MAC address replacement. However, you are right that this option is not clearly documented in the reference manual.

This matter is being tracked internally. An internal ticket (209773) has already been raised for follow-up.

 

With Regards,

 

If your question is answered, please close this topic by clicking "Accept as Solution".