This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6f7d54d096413fbb68752bbc64845be69b9fe9d9
Author: Daniel P. Carvalho <[email protected]>
AuthorDate: Sun Sep 13 12:21:39 2026 -0300

    arch/arm/stm32: Disable reception of self-transmitted frames.
    
    Set ETH_MACCR_ROD unconditionally when configuring the MAC. In
    half-duplex mode the MAC otherwise reflects every frame it transmits
    back to its own receiver, flooding the receive path with our own
    traffic right as a genuine reply arrives. The bit has no effect in
    full-duplex (confirmed on our hardware: fduplex=1), so setting it
    unconditionally is safe and changes nothing observable for boards
    already running full-duplex.
    
    The sibling stm32f7 driver has the same gap (ETH_MACCR_ROD cleared
    but never set) and stm32h7's equivalent ETH_MACCR_DO bit has the same
    issue; both are left out of scope here since only m3m4_v1 hardware
    was available to validate against.
    
    Assisted-by: Claude:claude-sonnet-5
    Signed-off-by: Daniel P. Carvalho <[email protected]>
    (cherry picked from commit 41536cb8c9f5ff448864d2eb490b35aea7cdafcf)
---
 arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c 
b/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c
index 6614bdc1073..a033064d3f3 100644
--- a/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c
+++ b/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c
@@ -3913,6 +3913,16 @@ static int stm32_macconfig(struct stm32_ethmac_s *priv)
   regval &= ~MACCR_CLEAR_BITS;
   regval |= MACCR_SET_BITS;
 
+  /* Disable reception of our own transmitted frames. In half-duplex
+   * mode the MAC otherwise reflects every frame it transmits back to
+   * its own receiver (this bit has no effect in full-duplex, so it is
+   * safe to set unconditionally). Without it, a busy transmitter can
+   * flood the receive path with its own traffic right as a genuine
+   * reply arrives.
+   */
+
+  regval |= ETH_MACCR_ROD;
+
   if (priv->fduplex)
     {
       /* Set the DM bit for full duplex support */

Reply via email to