micro_ros_stm32cubemx_utils icon indicating copy to clipboard operation
micro_ros_stm32cubemx_utils copied to clipboard

Get Error and warning ...(.text._gettimeofday_r+0xe): warning: _gettimeofday is not implemented and will always fail

Open hishambaharom opened this issue 1 year ago • 1 comments

Hi,

I Get this error: /home/shahrol/st/stm32cubeide_1.11.0_6/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/shahrol/st/stm32cubeide_1.11.0_6/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-gettimeofdayr.o): in function `_gettimeofday_r':

(.text._gettimeofday_r+0xe): warning: _gettimeofday is not implemented and will always fail

when I upgrade the STM32CubeIde from version 1.11.0 to 1.13.0. I figure out this error is generate when I init the rclc_executor...rclc_executor_init(&main_executor, &support.context, 5, &allocator);

How to resolve this error

hishambaharom avatar Jul 23 '23 16:07 hishambaharom

Hi, the function _gettimeofday is usually not implemented for embedded targets. Actually I'm surprised that you are saying it was working in version CubeIDE 1.11.0. Here: https://stackoverflow.com/questions/7004743/unable-to-link-to-gettimeofday-on-embedded-system-elapsed-time-suggestions you find some good explainations how to deal with this problem. Basically you need to implement that function on your own and decide which timer to be used for incrementing the time. If you have a battery buffered RTC you certainly can use this time. In this case you have a proper time of the day. Otherwise you just have a running counter that is assumed to be the time. Best Regards Markus

DrMarkusKrug avatar Aug 02 '23 10:08 DrMarkusKrug