cancel
Showing results for 
Search instead for 
Did you mean: 

ST example code has corrupted ETH RX Buffers

CHossack
Associate III

HI,

I’m working on ETH and FreeRTOS on the STM32H745 Nucleo-144. I’ve read about various problems on this forum about using the ethernet as detailed below

So when I saw this article from ST employees detailing how to use ETH and FreeRTOS, with examples I was really excited.

I took their STM32H745_Nucleo_M4_ETH example and added a very simple web site. It just said hello and displayed two large images

<!DOCTYPE HTML>
<html>
 <head>
  <title>STM32h745 TCP error</title>
 </head>
 <body>
  hello
  <img src="image1.jpg">
  <img src="image2.jpg">
 </body>
</html>

Here’s my code changes

\CM4\Core\Src\main.c

/* USER CODE BEGIN 4 */
extern void http_server_netconn_thread(void);
/* USER CODE END 4 */
 
 /* USER CODE BEGIN 5 */
 http_server_netconn_thread();
 /* USER CODE END 5 */

\CM4\LWIP\App\lwip.c – changed the static IP address to 192.168.0.130 (to suite my network)

void MX_LWIP_Init(void)
{
 /* IP addresses initialization */
 IP_ADDRESS[0] = 192;
 IP_ADDRESS[1] = 168;
 IP_ADDRESS[2] = 0;
 IP_ADDRESS[3] = 130;

New Files

  • \CM4\Core\Src\website\favicon.jpg – small icon from web page tab
  • \CM4\Core\Src\website\image1.jpg – medium size image
  • \CM4\Core\Src\website\image2.jpg – large size image
  • \CM4\Core\Src\website\index.html – main web page
  • \CM4\Core\Src\makefsfile.exe – convert files in website into “C�? code
  • \CM4\Core\Src\makefsfile.bat – batch file to call makefsfile with correct arguments
  • \CM4\Core\Src\server.c – simple HTTP server based on ST other example code
  • \CM4\Core\Src\fsdata.h – website in “C�? code

But when the code below was called for “image2.jpg�? I found “buf�? is normally corrupted with leading zeros.

netbuf_data(inbuf, (void**)&buf, &buflen);

Looking at the “buf�? I can see the original HTTP request, but the ETH driver/DMA/?? has overwritten the start with zeros.

0693W00000KbQfsQAF.jpgLooking at the web browser I can see the actual request is valid.

0693W00000KbQgmQAF.jpgWhen the web server sees an empty string it returns back with 501, and the image is not loaded.

0693W00000KbQiNQAV.jpgI had come across this problem in my actual code last year, but couldn’t release it and maybe my code was at fault. So I was hoping using ST new example code would prove if I was doing something wrong or they had fixed it.

But now I have a small test project using a ST example that demonstrates the problem (99% of the time). So I’m hoping somebody (eg @Laura C, @Camilo LEMOS, @Brian Kling, who was involved in generating the ETH example code)  can look at the code, see the problem and fix it.

I’ve included the whole project as a zip file. If you debug it you need to change one of the debug configurations to use a different GDB port number, eg 61238, otherwise it will clash.

0693W00000KbQiwQAF.jpgCheers

Chris

4 REPLIES 4
MWB_CHa
ST Employee

Probably too late to answer this ticket, sorry, but it might be useful for someone who has similar issue:

It seems that is the same major bug on the old driver RX data corrupted and it was resolved in the new one but when downloading test case attached to the ticket it seems to be still using the old Ethernet driver despite the fact you talk about using the new driver.

https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernet

Hi Chekib,

so are you saying the examples from "How to create project for STM32H7 with Ethernet and LwIP stack working" are now fixed?

cheers

Chris

MWB_CHa
ST Employee

Hi @CHossack​ 

What I mean is that: if you use now, the updated STM32H7 CubeFW latest version and the latest version of STM32CubeMX you should not see that issue.

I hope it helps.

Hello Team,

I done the same in new firmware in STM32H745ZI-Q (M7) as mentioned the same configuration of ethernet stack and it seems to have the same issue during the display of webpage.

New project was created with the mentioned configuration and seems that I'm unable to see images.

Please let me know incase of any configuration issue from my side or is there any latest bug fixes coming from ST to solve the issue.

Project attached.

Regards