Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32h7xx_hal_eth.c bug report #302

Closed
Gorden1970 opened this issue Dec 19, 2024 · 5 comments
Closed

stm32h7xx_hal_eth.c bug report #302

Gorden1970 opened this issue Dec 19, 2024 · 5 comments
Assignees
Labels
bug Something isn't working eth Ethernet hal HAL-LL driver-related issue or pull-request. invalid This doesn't seem right

Comments

@Gorden1970
Copy link

Gorden1970 commented Dec 19, 2024

STM32H7 HAL Library version 1.12.0 and 1.12.1 stm32h7xx_hal_eth.c line number 2503 content is as follows

((uint32_t)((pFilterConfig->BroadcastFilter == ENABLE) ? 1U : 0U) << 5) |

STM32H7 HAL Library version 1.11.0 and 1.11.1 stm32h7xx_hal_eth.c line number 2503 content is as follows

((uint32_t)((pFilterConfig->BroadcastFilter == DISABLE) ? 1U : 0U) << 5) |

STM32H7 HAL Library version 1.12.0 and 1.12.1 will cause ETH to be unusable, I check file RM0399 description

Bit 5 DBF: Disable Broadcast Packets
When this bit is set, the AFM module blocks all incoming broadcast packets. In addition, it
overrides all other filter settings.
When this bit is reset, the AFM module passes all received broadcast packets.

@mikhail11111
Copy link

mikhail11111 commented Dec 20, 2024

In version 1.12.1 I set it as DISABLE, but Ethernet still doesn't work in the program that worked with 1.11.1.

@ALABSTM ALABSTM added bug Something isn't working hal HAL-LL driver-related issue or pull-request. eth Ethernet labels Dec 20, 2024
@ASEHSTM
Copy link

ASEHSTM commented Dec 24, 2024

Hello @Gorden1970,

Thank you for your report. However, referring to the reference manual, when bit 5 is set, broadcast packets are disabled, which means that the BroadcastFilter is enabled. Therefore, the correct code is from version 1.12.0 and 1.12.1:

((uint32_t)((pFilterConfig->BroadcastFilter == ENABLE) ? 1U : 0U) << 5)

This ensures that when the BroadcastFilter is enabled, bit 5 is set to 1 to block broadcast packets. Conversely, when the BroadcastFilter is disabled, bit 5 is set to 0 to allow all broadcast packets to pass.

With Regards,

@ASEHSTM ASEHSTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard Dec 24, 2024
@Gorden1970
Copy link
Author

I agree with this and think what you said is right, but the drivers currently provided by Keil MDK are as follows

Driver_ETH_MAC.h
#define ARM_ETH_MAC_ADDRESS_BROADCAST (1UL << 7) ///< Accept frames with Broadcast address

ETH_MAC_STM32.c
if ((arg & ARM_ETH_MAC_ADDRESS_BROADCAST) != 0U) { // --- Broadcast Frame address
eth_mac0_rw_info.mac_filter.BroadcastFilter = ENABLE;
} else {
eth_mac0_rw_info.mac_filter.BroadcastFilter = DISABLE;
}

This will cause existing projects to not function properly on V1.12.1. I can only modify to DISABLE during transition.

And thank you for your reply

@ASEHSTM
Copy link

ASEHSTM commented Jan 13, 2025

Hello @Gorden1970,

This issue is related to the driver provided by Keil MDK. On our side, the correct code is from versions 1.12.0 and 1.12.1.

You can report the issue on this forum: https://github.com/Open-CMSIS-Pack/CMSIS-Driver_STM32/blob/main/Drivers/ETH_MAC_STM32.c

Thank you.
With Regards,

@ASEHSTM
Copy link

ASEHSTM commented Jan 17, 2025

Hello @Gorden1970,

Please allow me to close this ticket.

With Regards,

@ASEHSTM ASEHSTM closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2025
@github-project-automation github-project-automation bot moved this from Analyzed to Done in stm32cube-mcu-fw-dashboard Jan 17, 2025
@ALABSTM ALABSTM added the invalid This doesn't seem right label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working eth Ethernet hal HAL-LL driver-related issue or pull-request. invalid This doesn't seem right
Projects
Development

No branches or pull requests

4 participants