cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CubeMX LwIP Code generator: redefine struct timeval

Markus Rudolf
Associate III
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
Imen.D
ST Employee
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
Senior
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.

Posted on July 04, 2017 at 14:06

This issue will be fixed in next STM32CubeMX 4.22.0 release.

Posted on October 17, 2017 at 19:25

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

Bino
Senior
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
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)
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.

Posted on October 31, 2017 at 15:22

I just updated to 4.23.0 and I get the same two issues. 

(Target: STM32F407VG    

F4 firmware: 1.17)

Posted on October 31, 2017 at 15:53

Hello

cratelle

,

I confirm that regression observe in the 4.1 has been corrected in 4.

If you still encounter this issue, could you please describe your environment:

Are you using a makefile ? If yes, do you used the generated makefile by Cube ?

Are you using an IDE build ? If yes which one ?

Could you share your ioc, then we can test it in our end ?

Great thanks in advance.

Kind regards

Sirma