cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP request to my STM32 make it loose connection with Ping - No web pages are shown

DMårt
Senior III

Hi!

I have done the following this:

  • Make so ping works - OK (https://controllerstech.com/stm32-ethernet-1-connection/)
  • Create a simple echo TCP Server - OK (https://controllerstech.com/stm32-ethernet-4-tcp-server/)

These things works. Very good.

But then when I enable HTTPD inside my STM32CubeIDE 1.10.1 and then add a new a fsdata_custom.c or fsdata.c file to my project. Just like they are doing:

https://www.youtube.com/watch?v=cYynDc82g4w

https://controllerstech.com/stm32-ethernet-6-http-webserver-simple/

Then it won't work for me. What happens is that when I use my web browser and go to my STM32 address .e.g 192.168.1.15, then I cannot ping any longer to my STM32. But...IF....I ping first, then I can see that the ping stuff is working. But as long I use my web browser to surf into my STM32, then I cannot longer ping my STM32. So I need to restart it. No web site appears at my web browser.

I have tested to debug, but the processor runs and have not fallen into a endles error-loop. So what can be wrong here?

int main(void)
{
  /* USER CODE BEGIN 1 */
 
  /* USER CODE END 1 */
 
  /* MCU Configuration--------------------------------------------------------*/
 
  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();
 
  /* USER CODE BEGIN Init */
 
  /* USER CODE END Init */
 
  /* Configure the system clock */
  SystemClock_Config();
 
  /* USER CODE BEGIN SysInit */
 
  /* USER CODE END SysInit */
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_FSMC_Init();
  MX_DCMI_Init();
  MX_SPI2_Init();
  MX_TIM1_Init();
  MX_TIM3_Init();
  MX_ADC1_Init();
  MX_CAN1_Init();
  MX_RTC_Init();
  MX_TIM4_Init();
  MX_UART5_Init();
  MX_I2C1_Init();
  MX_LWIP_Init();
  /* USER CODE BEGIN 2 */
 
 
  httpd_init();
 
 
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
	  MX_LWIP_Process(); // Without this, I cannot ping.
  }
  /* USER CODE END 3 */
}

My processor is: STM32F407VGT and I'm using the firmware FW_F4_1.27.1

1 REPLY 1
MSG_ST
ST Employee

Hi,

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 server's pictures.

The solution is to move buffers to SRAM in fsdata_custom.c file by removing "const".

Sorry for the delayed answer.

Regards

Mahdy