STMicroelectronics / STM32CubeF4

STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
823 stars 408 forks source link

HTTP IAP bug #137

Open khevessy opened 1 year ago

khevessy commented 1 year ago

There is a potential bug in the HTTP IAP example. In the web server, there this this if clause: https://github.com/STMicroelectronics/STM32CubeF4/blob/52757b5e33259a088509a777a9e3a5b971194c7d/Projects/STM324xG_EVAL/Applications/LwIP/LwIP_IAP/Src/httpserver.c#L231-L246 and https://github.com/STMicroelectronics/STM32CubeF4/blob/52757b5e33259a088509a777a9e3a5b971194c7d/Projects/STM324x9I_EVAL/Applications/LwIP/LwIP_IAP/Src/httpserver.c#L231-L246 which handles GET request. POST request and subsequent data frames are handled in an else if on line 302. However, when we will be receiving data and the binary that we are trying to load is containing the exact string GET / HTTP and it will be at the beginning of the packet (it happened to me in slight variation), we will reset the site prior to writing the whole binary. My suggestion would be to either move the else if for POST request to the beginning of the if, or add check for which htmlpage we are on to the line 231.

I have made an issue in the STM32CubeF7 project, where there is a similar problem. I do not know if there is any other MCU family with this HTTP IAP example, but if there is and you will decide to fix this, please propagate the solution there. The same problem is in the STSW-STM32069 package that implements this exact same functionality.

ASELSTM commented 1 year ago

Duplicate of STM32CubeF7#69.