cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CubeMX LwIP Code generator: redefine struct timeval

Markus Rudolf
Associate II
Posted on December 19, 2016 at 22:17

I'm using CubeMX 4.18 to generate my code for an STM32F407VG for the System Workbench using the arm-gcc. Works great, except for in socket.h it complains about redefinion of struct timeval.

When I manually set

&sharpdefine LWIP_TIMEVAL_PRIVATE 0

in socket.h

and do a

&sharpinclude <sys/time.h>

in cc.h as suggested, it builds.

But of course every time I make changes to my CubeMX project, it gets overwritten and I have manually edit again.

Please fix this in the next release!

Otherwise great tool!

Markus

#code-generation #lwip #cubemx-bug #cube
15 REPLIES 15
Posted on November 01, 2017 at 19:33

I also still have the same issue on CubeMX 4.23. 

Board nucleo-f429zi and STM32CubeF4 is of v1.17.0

Compiling with makefile arm-gcc-none-eabi       version: 5.3 2016q1

All is done on linux

Here are some of the error messages after compiling

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `initialise_monitor_handles'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_getpid'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_kill'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_exit'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_write'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_close'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_fstat'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_isatty'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_lseek'

build/syscalls.o:/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: first defined here

build/syscalls.o: In function `_sbrk':

/home/raivis/st_code/lwip_test_f429zi/Src/syscalls.c:102: multiple definition of `_read'

....

Imen.D
ST Employee
Posted on November 02, 2017 at 11:05

Hello

Strogonovs.Raivi

,

I branched your second issue into a new discussion

https://community.st.com/0D50X00009XkXAgSAN

, as it's a new problem related to the makefile/Linux.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on November 03, 2017 at 19:36

Hi

SIRY.Marc

‌,

I'm generating for GPDSC (VisualGDB).

Link to ioc :

https://drive.google.com/file/d/0Bz0PMTaNbtLgcmJCTFJXcldLUFE/view?usp=sharing

Thanks,

Posted on April 29, 2018 at 22:09

I'm not sure quite the status is of the regression/correction of this issue as of 4/29/2018, but definitely making the definition within lwipopts.h worked. It's the right way to do the wrong thing.

TDrzy
Associate II

There is still bug with redefinition of 'struct timeval' when I use lwip.

Now in version 5.0.0

Markus Rudolf
Associate II

Good to know... I assume the whole V5.0.0 is a failure GUI-wise, I had hopes that at least the code generator bugs have been fixed.