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

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 440298b4c stm32_eth: Fix multicast configuration
440298b4c is described below

commit 440298b4cc61d00fa2b10f1046f3644ac2c0300e
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Wed Mar 11 10:34:55 2026 +0100

    stm32_eth: Fix multicast configuration
    
    Code was trying to disable MAC address filtering
    for multicast but configuration was done before
    HAL_ETH_Init that disabled it again.
    
    Now multicast filtering is off.
    No conditional for H7 device as HAL api is common
    for F4,F7,H7,H5 devices.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/drivers/lwip/stm32_eth/src/stm32_eth.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c 
b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
index 3f5ba8ebf..137a0e80b 100644
--- a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
+++ b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
@@ -295,6 +295,9 @@ stm32_lwip_init(struct netif *nif)
     int i, j;
     const struct stm32_eth_cfg *cfg;
     uint32_t reg;
+    const ETH_MACFilterConfigTypeDef filterConfig = {
+        .PassAllMulticast = ENABLE,
+    };
 
     /*
      * LwIP clears most of these field in netif_add() before calling
@@ -353,19 +356,15 @@ stm32_lwip_init(struct netif *nif)
     ses->st_tx_cfg.ChecksumCtrl = ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC;
     ses->st_tx_cfg.CRCPadCtrl = ETH_CRC_PAD_INSERT;
 
-    /*
-     * XXX pass all multicast traffic for now
-     */
-#if MYNEWT_VAL(MCU_STM32H7)
-    ses->st_eth.Instance->MACPFR |= ETH_MACPFR_PM;
-#else
-    ses->st_eth.Instance->MACFFR |= ETH_MULTICASTFRAMESFILTER_NONE;
-#endif
-
     if (HAL_ETH_Init(&ses->st_eth) == HAL_ERROR) {
         return ERR_IF;
     }
 
+    /*
+     * XXX pass all multicast traffic for now
+     */
+    HAL_ETH_SetMACFilterConfig(&ses->st_eth, &filterConfig);
+
     /*
      * Generate an interrupt when link state changes
      */

Reply via email to