cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX5.6 lwIP code generated for stm32f407 discovery board doesn't compile in KEIL 5.29 Arm Compiler 6.13

naser moravej
Associate III

Hello everyone,

I generated a code for having ethernet on stm32f407 discovery board.

I just enabled lwIP and ethernet in cubeMX and nothing more.

when I compiled the generated code in KEIL 5.29 Arm Compiler version5, everything is OK, but when I change compiler to Arm Compiler version6, I got this error. I've got 83 errors because of missing <sys/time.h>

Thanks for you're answers.

../Src/lwip.c(21): warning: In file included from...
../Inc\lwip.h(28): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/opt.h(52): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/debug.h(40): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/arch.h(48): warning: In file included from...
../Middlewares/Third_Party/LwIP/system\arch/cc.h(46): error: 'sys/time.h' file not found
#include <sys/time.h>
         ^~~~~~~~~~~~
1 error generated.
compiling lwip.c...
../Src/main.c(23): warning: In file included from...
../Inc\lwip.h(28): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/opt.h(52): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/debug.h(40): warning: In file included from...
../Middlewares/Third_Party/LwIP/src/include\lwip/arch.h(48): warning: In file included from...
../Middlewares/Third_Party/LwIP/system\arch/cc.h(46): error: 'sys/time.h' file not found
#include <sys/time.h>
         ^~~~~~~~~~~~

2 REPLIES 2

Hi @naser moravej​ 

Could you please share your .ioc file to check the issue.

Please tell me which STM32CubeMX version do you use.

Best regards,

Nesrine

Junde
Senior II

Refer to HERE for the solution.

#if defined (__GNUC__) && !defined (__CC_ARM) && !(defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))

Junde_0-1719885166540.png