2019-05-05 05:37 AM
I built a tiny project from scratch with LwIP (without FreeRTOS).
CubeMX generates a project without any errors which I can compile and run.
But when I modify my source code in main.c every compile stops with:
../Inc/lwip.h:28:10: fatal error: lwip/opt.h: No such file or directory
In Tool Settings->MCU GCC Compiler->Includes are no entries in the list.
I added at least:
../Middlewares/Third_Party/LwIP/src/include
../Middlewares/Third_Party/LwIP/system
../Middlewares/Third_Party/LwIP/src/include/lwip
../Middlewares/Third_Party/LwIP/src/include/lwip/apps
../Middlewares/Third_Party/LwIP/src/include/lwip/priv
../Middlewares/Third_Party/LwIP/src/include/lwip/prot
Same problem.
But when I make a change in CubeMX, save it and new code is generated
the project can be compiled.
How can I fix this to be able to compile a project with LwIP in STMCubeIDE ?
Thank you.
2019-05-06 09:12 AM
I tried creating a LwIP project but I can't reproduce your issue. I can make changes to my main.c file just fine and it still works.
If you can specify a way for me to reproduce this, step-by-step then I might be able to be more helpful.
2019-05-06 09:26 AM
I created now a second project and copied all the include paths into the first one.
Now it works, I can compile after changing the code.
Like I said, the include paths list was empty.
Thank you.
2019-05-08 02:26 AM
After this fix I changed my code concerning SPI only.
But sometimes this occurs:
.../Debug/../Src/ethernetif.c:563: undefined reference to `etharp_output'
Src/lwip.o: In function `MX_LWIP_Init':
.../Debug/../Src/lwip.c:72: undefined reference to `lwip_init'
.../Debug/../Src/lwip.c:80: undefined reference to `netif_add'
.../Debug/../Src/lwip.c:83: undefined reference to `netif_set_default'
.../Debug/../Src/lwip.c:88: undefined reference to `netif_set_up'
.../Debug/../Src/lwip.c:93: undefined reference to `netif_set_down'
.../Debug/../Src/lwip.c:99: undefined reference to `ethernet_input'
collect2: error: ld returned 1 exit status
make: *** [makefile:41: pccv4_767.elf] Error 1
( The ... represents the full correct path)
I do not use network functions this time (comes later), LwIP is just enabled in the project.
The only way I know to get rid of this errors is to change the .ioc file with CubeMX and regenerate the project.
This can not be the way to work serious.
2019-05-08 04:51 AM
So this error appears and you can "work around" that problem by regenerating the project?
And when you do so everything works fine again?
2019-05-08 05:17 AM
Yes. Regenerating is the magic.
But lwip compiling errors do not occur after each compile.
It happens sometimes.
Edited: It happens most of the time when I start STM32CubeIDE.
I came from SW4STM32 and never had a similar problem.