Skip to main content
Associate
October 11, 2023
Solved

STM32Cube IDE build error

  • October 11, 2023
  • 1 reply
  • 1904 views

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.

This topic has been closed for replies.
Best answer by MikaelM

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

1 reply

MikaelM
MikaelMBest answer
ST Employee
October 11, 2023

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.
MathilAuthor
Associate
October 12, 2023

@MikaelM Thank you for the solution.