cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube IDE build error

Mathil
Associate

I am working with STM32U575, When building my project I am facing an issue. 
The error is as follows:

C:/ST/STM32CubeIDE_1.13.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main+fp/hard\libc_nano.a(libc_a-gettimeofdayr.o): in function `_gettimeofday_r':

Could somebody please help me how to resolve the issue.

1 ACCEPTED SOLUTION

Accepted Solutions
MikaelM
ST Employee

Hello @Mathil 

maybe this post could help you :
https://community.st.com/t5/stm32cubeide-mcus/gettimeofday-r-error-come-while-i-am-building-with-latest-stm/td-p/579637

This issue will be fixed soon. At that time you have to define your own function. You can define it as "empty" and return 0, just to get rid of this warning message if you don't want to use it.
Else you can implement a function using the RTC to get the date and time after you have programming correctly the RTC calendar and time.

So you can add a file named time.c if not having one and then add the following empty function :

#include <sys/time.h>
int _gettimeofday( struct timeval *tv, void *tzvp )
{
// you can add code here.
return 0; // return non-zero for error
} // end _gettimeofday()

best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.

View solution in original post

2 REPLIES 2
MikaelM
ST Employee

Hello @Mathil 

maybe this post could help you :
https://community.st.com/t5/stm32cubeide-mcus/gettimeofday-r-error-come-while-i-am-building-with-latest-stm/td-p/579637

This issue will be fixed soon. At that time you have to define your own function. You can define it as "empty" and return 0, just to get rid of this warning message if you don't want to use it.
Else you can implement a function using the RTC to get the date and time after you have programming correctly the RTC calendar and time.

So you can add a file named time.c if not having one and then add the following empty function :

#include <sys/time.h>
int _gettimeofday( struct timeval *tv, void *tzvp )
{
// you can add code here.
return 0; // return non-zero for error
} // end _gettimeofday()

best regards

Mikael

If you feel a post has answered your question, please click Accept as Solution.

@MikaelM Thank you for the solution.