Skip to main content
dp65
Associate
March 14, 2022
Question

STM32H7 - CubeMX 6.5.0 + Lwip + FreeRTOS: Some problems in ethernetif.c

  • March 14, 2022
  • 8 replies
  • 3049 views

Since CubeMX changed to 6.5.0 and Firmware Package to V1.10.0 (included full-reworked ETH driver) Ethernet on existing project became not work after code regeneration.

Detailed investigation shows that:

  1. Definition of memory location for RX_POOL (memp_memory_RX_POOL_base[]) is missed. Result of this - DMA fault on reception of any packet.
  2. In the function ethernet_link_thread() at section under if(linkchanged){} used HAL_ETH_Start(&EthHandle); instead of HAL_ETH_Start_IT(&EthHandle);. That stops ETH after reconnect a cable.

Software example that supplied with Firmware Package (LwIP_HTTP_Server_Netconn_RTOS) works fine and free of issues, described above.

But ethernetif.c, generated by CubeMX, needs to be corrected manually.

Also, it seems have to change Cortex_M7 memory regions settings exactly as in software example.

This topic has been closed for replies.

8 replies

Muhammed Güler
Senior III
March 18, 2022

I was alone with a code that didn't work after the update. Thanks for reporting the bug. It was very helpful.

Amel NASRI
Technical Moderator
March 28, 2022

Hi @Community member​,

Thanks for sharing your finds.

It is worth to bring it to the attention of our STM32CubeMX experts @Sara BEN HADJ YAHYA​ and @Khouloud OTHMAN​  to more investigate & share with us taken actions.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Armandas
Associate II
June 21, 2022

@Amel NASRI​ @Sara BEN HADJ YAHYA​ @Khouloud OTHMAN​ 

Any update on this?

Same issue is also reported here: https://community.st.com/s/question/0D53W00001TgW6xSAF/project-generation-for-stm32h7-with-freertos-lwip

Armandas
Associate II
June 22, 2022

For those who pressed the Migrate button, you can revert to the working version by editing the IOC file with a text editor and changing the parameters as below:

ProjectManager.FirmwarePackage=STM32Cube FW_H7 V1.9.0
MxDb.Version=DB.6.0.21

WGend.15
Associate II
July 11, 2022

I also had the second bug mentionned in this post after migrating to latest firmware package!

Please fix this! it looks like an easy fix !

"In the function ethernet_link_thread() at section under if(linkchanged){} used HAL_ETH_Start(&EthHandle); instead of HAL_ETH_Start_IT(&EthHandle);. That stops ETH after reconnect a cable.

Pavel A.
Super User
July 11, 2022

@Community member​ Do you have the latest? CubeMX 6.6.1 or IDE 1.10.1?

WGend.15
Associate II
July 11, 2022

@Pavel A.​ Yes, I got the latest IDE (1.10.1) just today and i'm using STMfirmware package 1.17 for stm32F7

Piranha
Principal III
July 20, 2022
JArig.1
Associate
July 22, 2022

Guys, my recommendation, stop using the ETH+LWIP implementation from ST. There are problems since years and they do not manage to get a real stable setup, even with the new driver.

In my application I needed a high reliable and high speed data communication (TCP) in an STM32H743. I've fought for months against LWIP but I had to give up. The speed was good but after 10 hours the STM stopped sending packets, it was just not reliable and unsuited for a high availability application.

I have switched to FreeRTOS+TCP and IT IS A BREEZE. It runs for days, weeks, w/o an issue. The integration is not that difficult either and the guys in the community forums are very supportive and have good knowledge:

https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/index.html

Finally an ETH Stack that WORKS!