Hi,
I am working on SLN-VIZNLC-IOT kit and making some modifications on the display. One of the requirements we have is to display time on the screen.
To Set the time in the system I am calling "settimeofday()" API from <sys/time.h>. But, while compiling the code I am getting below error
c:/nxp/mcuxpressoide_11.7.1_9221/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.7.1.202301190959/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: ./source/main.o: in function `APP_BoardInit()':
D:\Face_detection\Debug/../source/main.cpp:69: undefined reference to `settimeofday'
But I am able to use "time()" API from <time.h>
Is there any specific flag or any other thing require to enable this?
Thanks,
Pratik
Solved! Go to Solution.
Hi @pratik040391 ,
Thanks for your information.
I don't think that can be supported in the solution SDK demo directly, as that is just an interface, but no the real resource for the time input.
So, still as I told you, if you need the time, use the external calendar chip to read it, then display it on the LCD, if the calendar uses pure software, no external chip, it is not very convenient.
Wish it helps you!
Best Regards,
Kerry
Hi @pratik040391 ,
Where you find "settimeofday()" API from <sys/time.h>?
I didn't find the sys, time.h from the SDK in the Github:
https://github.com/NXP/mcu-viznlc
Please help to check the sys/time.h source code, thanks. Seems our SDK didn't support it.
Best Regards,
Kerry
Thanks @kerryzhou for the response.
If this API is not being supported by SDK then Is there an alternative to set system time?
Thanks,
Pratik
Hi @pratik040391 ,
The settimeofday, do you find it from the SDK?
As I and the solution team didn't find this API, do you find it in the SDK? If yes, let me know the file path, thanks, we will check it.
If the SDK is not support the settime, then you need to add it by yourself, eg, add the calendar chip, then you can read the daytime from the calendar chip directly, then you just need to display it.
Wish it helps you!
Best Regards,
Kerry
Hi @kerryzhou
I can not find the source code in the sdk. But, I can find "sys/time.h" at below location,
C:\nxp\MCUXpressoIDE_11.7.1_9221\ide\plugins\com.nxp.mcuxpresso.tools.win32_11.7.1.202301190959\tools\arm-none-eabi\include\sys
So, When I am adding this API, it will find declaration from above path but when I try to compile the it gives me an undefined reference error.
Thanks,
Pratik
Hi @pratik040391 ,
Thanks for your information.
I don't think that can be supported in the solution SDK demo directly, as that is just an interface, but no the real resource for the time input.
So, still as I told you, if you need the time, use the external calendar chip to read it, then display it on the LCD, if the calendar uses pure software, no external chip, it is not very convenient.
Wish it helps you!
Best Regards,
Kerry
@kerryzhou Thank you for the explanation and suggestion. Currently I have added timer based counter to handle the clock.
Thanks,
Pratik
Hi @pratik040391 ,
From your description, seems lack the definition, do you add the header file in the main.cpp?
I mean, sys/time.h in the main.cpp.
I also help you to check with our internal solution team, I get the answer that, this function is not added in the solution, so, need the customer to write the related code and display it.
Wish it helps you!
Best Regards,
Kerry