This is an automated email from the ASF dual-hosted git repository.
kasjer 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 5f9971e4b drivers/stm32_eth: Do not drop broadcast frames
5f9971e4b is described below
commit 5f9971e4b44a60c8ce6792f637f927aec0dbc93c
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Wed Oct 14 11:38:42 2026 +0200
drivers/stm32_eth: Do not drop broadcast frames
MAC filter configuration was built from zero initialized structure
with only PassAllMulticast set. In F4, F7 and H7 HAL zero value of
BroadcastFilter sets BFD bit and MAC drops all broadcast frames, so
ARP requests were never received and the device was reachable only
while peers had its address cached. H5 HAL has opposite meaning of
this field so the problem was not visible there.
Read current filter configuration, which after HAL_ETH_Init() has
broadcast reception enabled on all families, and only enable passing
of all multicast frames.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jerzy Kasenberg <[email protected]>
---
hw/drivers/lwip/stm32_eth/src/stm32_eth.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
index 8e6a12da5..c71dde793 100644
--- a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
+++ b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
@@ -472,9 +472,7 @@ stm32_lwip_init(struct netif *nif)
int i, j;
const struct stm32_eth_cfg *cfg;
uint32_t reg;
- ETH_MACFilterConfigTypeDef filterConfig = {
- .PassAllMulticast = ENABLE,
- };
+ ETH_MACFilterConfigTypeDef filterConfig;
/*
* LwIP clears most of these field in netif_add() before calling
@@ -539,7 +537,14 @@ stm32_lwip_init(struct netif *nif)
/*
* XXX pass all multicast traffic for now
+ *
+ * Modify current filter settings instead of building them from zero.
+ * Meaning of BroadcastFilter differs between HAL families (F4/F7/H7
+ * DISABLE drops broadcast frames, H5 ENABLE does), reset value of the
+ * register accepts broadcast (ARP) frames on all of them.
*/
+ HAL_ETH_GetMACFilterConfig(&ses->st_eth, &filterConfig);
+ filterConfig.PassAllMulticast = ENABLE;
HAL_ETH_SetMACFilterConfig(&ses->st_eth, &filterConfig);
/*