Showing results for 
Search instead for 
Did you mean: 

HTTP request to STM32 + LwIP results that Ping stops working

Senior II


Recently I had problems with ping to my STM32 + LwIP + DP83848 + RMII. But the latest FW version 1.27.1, it works very well! But now I have problems with HTTP. Follow me and I show you how to create this bug.

First of all I'm using:

  • STM32CubeIDE 1.10.1
  • STM32F407VGT
  • FW 1.27.1

To reproduce this bug, do the following steps.

  • Step 1: Enable RMII by going to ETH -> RMII (Rx Buffer length 1524, MAC address 00:80:E1:00:00:00, Rx Mode = Interrupt, NVIC settings = Ethernet Global Interrupt)
  • Step 2: Go to FREERTOS and enable CMSIS V2 and go to Task & Queues. Change the Stack Size (Words) in defaultTask from 128 to 1024.
  • Step 3: Inside CMSIS V2, go to Advanced settings and set USE_NEWLIB_REENTRANT = Enabled. Leave everything else as default.
  • Step 4: Go to LWIP and enable it. Set LWIP_DHCP = disabled in General Settings and then write in the fixed IP address. In my case it is
  • Step 5: Inside LWIP, go to HTTPD and set LWIP_HTTPD = enabled. Inside LWIP go to Key Options and set MEM_SIZE = 10*1024. Leave everything else as default.
  • Step 6: Download the folder and extract it.
  • Step 7: The folder contains a folder called FS and makeFSdata.exe. The makeFSdata.exe file will create a file called fsdata.c. Click on that.
  • Step 8: When the makeFSdata.exe file have created fsdata.c then rename fsdata.c to fsdata_custom.c.
  • Step 9: Place fsdata_custom.c at \Middlewares\Third_Party\LwIP\src\apps
  • Step 10: Right click fsdata_custom.c -> Resource Configurations -> Extract From Build ... -> Select All -> OK.
  • Step 11: Compile the project to your STM32 board and then ping.


OK! It Working great!

  • Step 12: Download and extract it into the projects src folder.
  • Step 13: Write this into your main.c file
#include "HTTP_Server/httpserver.h"
  • Step 14: Add http_server_init(); to
/* USER CODE BEGIN Header_StartDefaultTask */
  * @brief  Function implementing the defaultTask thread.
  * @param  argument: Not used
  * @retval None
/* USER CODE END Header_StartDefaultTask */
void StartDefaultTask(void *argument)
  /* init code for LWIP */
  /* Infinite loop */
  /* USER CODE END 5 */
  • Step 15: Compile and go to your web browser and type in No web site is displayed. Also if I ping now, then I get no response....BUT....if I restart the processor, then ping, the ping is working. But as long I don't go to the website, my STM32 processor have connection to the DHCP server and I can ping it.


Why does this happen?

I have followed this tutorial 100% (except that he are using another processor)

This must be a bug, becase in FW 1.27.0 version, I had problems with ping my processor. In FW 1.27.1, the ping works like a charm. But now FW 1.27.1 resulting that my HTTPD won't work.

Thank you.

Chief II

So, do you have any suggestions why HTTP not working for me, but ping works?

Because of the issues listed in that topic! Until the lower layers are reliable, there is no point in wondering why higher layers don't work.

I understand.

I will have to wait until ST-dev team will fix this....if they do?

I have seen a markable development when FW 1.27.1 was released. Now Ping works for me. Ping did not work for me when I was using FW 1.27.0.


They have fixed only a tiny part of the issues since my network issue list topic was started in year 2019.

Recently I added a comment about CubeF4 v1.27.1 in this topic.

I understand. Very sad. So ST's HAL-libraries is very bad to use?

ST Employee

Hi @Daniel Mårtensson​ ,

Thank you for your feedback.

The mentioned bug is confirmed.

It is due to Hardware limitation, in fact the Ethernet MAC does not have access to the Flash (in STM32F407 device) to download http's data.

The solution is to move HTTP files to SRAM in by removing the "const".

Sorry for the delayed answer.



Where is the const data type? When will ST implement this bug fix in next STCubeMXIDE?

Is there any more information about this bug?