diff --git a/mongoose.h b/mongoose.h
index ed2c669cd8a5be7c0072b56f60f4babecef32d7c..742deab678a652df1925afb7006c02a14d43cf37 100644
--- a/mongoose.h
+++ b/mongoose.h
@@ -1630,15 +1630,15 @@ char *inet_ntoa(struct in_addr in);
 #define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_
 #if CS_PLATFORM == CS_P_STM32
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
-#include <memory.h>
 #include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
 #include <stm32_sdk_hal.h>
 
 #define to64(x) strtoll(x, NULL, 10)