zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.92k stars 6.65k forks source link

drivers: ethernet: stm32h7: DMA errors reported by the ethernet HAL driver #75072

Open cperera-aud opened 4 months ago

cperera-aud commented 4 months ago

Describe the bug When running a STM32H7 device (ST Nucleo H753ZI) on an ethernet network, the ethernet HAL driver is detecting RX DMA errors. I have created a minimal example to reproduce the issue and the error detected is "Receive Buffer Unavailable" errors:

net_dhcpv4_client_sample: DMA ERRORS! 00004080 ![image](https://github.com/zephyrproject-rtos/zephyr/assets/16928715/3e9c4943-e07a-49e4-9dda-15bf8b5ebb5b) Are these errors real? Or should they be addressed? The device otherwise seems to be operating normally despite detecting these errors. I've only tried the scenario on a STM32H7, I'm not sure if the same errors are seen on other STM32 platforms. I am also using a custom board that uses an STM32H7 and on this board I'm also seeing the same Receive Buffer Unavailable error. Therefore, it doesn't seem to be an error isolated on a particular board. Please also mention any information which could help others to understand the problem you're facing: - What target platform are you using? **STM32H7** - What have you tried to diagnose or workaround this issue? - Is this a regression? If yes, have you been able to "git bisect" it to a specific commit? **Not that I'm aware of** - ... **To Reproduce** Steps to reproduce the behavior: 1. Checkout eth_rx_dma_errors branch in https://github.com/Audinate/zephyr 2. In zephyr, west build -p always -b nucleo_h753zi samples/net/dhcpv4_client 3. Flash the zephyr.bin or zephyr.elf file to the Nucleo H753ZI board 4. Plug the device in an ethernet network, ideally with other ethernet devices connected on the same network 5. Wait for the device to report DMA ERRORS on the UART console **Expected behavior** I would not expect to see DMA/MAC errors being reported unless there are some hardware issues **Impact** Otherwise since device is working as expected this is mostly an annoyance, however, that being said, if this is a real error, is there a possibility that it could improve performance? **Logs and console output** `[00:00:00.051,000] phy_mii: PHY (0) ID 7C131 *** Booting Zephyr OS build v3.7.0-rc1-454-g7c64a8b1a7ad *** [00:00:00.051,000] net_dhcpv4_client_sample: Run dhcpv4 client [00:00:00.051,000] net_dhcpv4_client_sample: Start on ethernet@40028000: index=1 [00:00:03.753,000] phy_mii: PHY (0) Link speed 100 Mb, full duplex [00:00:05.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:06.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:07.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:09.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:10.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:11.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:12.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:13.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:14.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:15.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 [00:00:15.063,000] net_dhcpv4_client_sample: DHCP Option 42: 10.13.1.1 [00:00:15.143,000] net_dhcpv4_client_sample: DHCP Option 42: 10.13.1.1 [00:00:15.143,000] net_dhcpv4: Received: 10.10.233.59 [00:00:15.144,000] net_dhcpv4_client_sample: Address[1]: 10.10.233.59 [00:00:15.144,000] net_dhcpv4_client_sample: Subnet[1]: 255.255.255.0 [00:00:15.144,000] net_dhcpv4_client_sample: Router[1]: 10.10.233.1 [00:00:15.144,000] net_dhcpv4_client_sample: Lease time[1]: 43200 seconds [00:00:16.051,000] net_dhcpv4_client_sample: DMA ERRORS! 00004080 ` **Environment (please complete the following information):** - OS: **Linux, Ubuntu 20.04** - Toolchain: **GNU ARM** - Commit SHA or Version used: 7c64a8b1a7ad7d7330c27affcf0569713c922bcf
github-actions[bot] commented 2 months ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

cperera-aud commented 2 months ago

Please remove stale label.

github-actions[bot] commented 3 weeks ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

cperera-aud commented 3 weeks ago

Please remove the stale label.