Skip to main content
Markus Rudolf
Associate III
December 19, 2016
Question

Bug in CubeMX LwIP Code generator: redefine struct timeval

  • December 19, 2016
  • 6 replies
  • 4531 views
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
This topic has been closed for replies.

6 replies

Technical Moderator
December 21, 2016
Posted on December 21, 2016 at 10:32

Dear

Rudolf.Markus

‌,

Your feedback is tracked internallyfor checking and further review.Thank you for your contribution.

All comments and suggestions are welcome.

Best Regards

-Imen-

When your question is answered, please close this topic by clicking "Accept as Solution".Thanks Imen
Bino
ST Employee
December 21, 2016
Posted on December 21, 2016 at 13:30

Hello Markus,

As you noticed, LwIP internal files not generated but copied by CubeMX are overwritten at each CubeMX generation.

There is a workaround waiting for a better solution: update your cc.h file directly in the CubeMX repository I mean in the folder defined in CubeMX menu>Help>Updater Settings: Repository Folder and here in the right FW package folder like  STM32Cube_FW_F4_V1.14.0\Middlewares\Third_Party\LwIP\system\arch\cc.h. By this way you will keep your update in LwIP stack.

Another suggestion is to define LWIP_TIMEVAL_PRIVATE setting in lwipopts.h generated in Inc folder within a USER SECTION so that the definition will be kept at each code generation.

I hope it will help.

Best Regards.

Eric A.

Bino
ST Employee
July 4, 2017
Posted on July 04, 2017 at 14:06

This issue will be fixed in next STM32CubeMX 4.22.0 release.

Evgeny Erlihman
Associate III
October 17, 2017
Posted on October 17, 2017 at 19:25

Was it fixed? Because i still get it with Version 4.22.1

Bino
ST Employee
October 18, 2017
Posted on October 18, 2017 at 09:34

You are right, the problem was fixed in 4.22 release but appears unfortunately again in 4.22.1 release.

Therefore, it will be definitively solved in coming 4.23 release.

Sorry for the inconvenience.

Y CS
Associate II
October 24, 2017
Posted on October 24, 2017 at 10:09

 ,

 ,

I have the same problem in 4.22.1 but in addition, after doing the workaround mentioned above, I'm getting 'error: redefinition of 'struct timezone' in the file syscalls.c

So I also needed to comment out 's

truct timezone' in syscalls.c (as it is enclosed in ' ♯ ifdef _SYS_TIME_H_')

Is this the same issue?

Will this also be fixed on 4.23?

When is 4.23 expected to be released?

(Target: STM32F427ZG ,  , ,

F4 firmware: 1.16)
Bino
ST Employee
October 30, 2017
Posted on October 30, 2017 at 09:41

Yes it is the same issue and what you did allows waiting for the fix.

The issue has been fixed in 4.23 release, which is on the web since week 43.

Sorry for the late response.

Technical Moderator
November 2, 2017
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
TDrzy
Associate
November 27, 2018

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

Now in version 5.0.0

Markus Rudolf
Associate III
November 27, 2018

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.