Unable to get RTC date/time from camera device from NXP iMX6 family board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to get RTC date/time from camera device from NXP iMX6 family board

496 Views
rajibgohain
Contributor I

Family: IMX6 

Description: We are trying to read hardware device time (camera device ) from the iMX6 board using open ioctl call. However, we are getting an error and negative value is returned from ioctl API. Please suggest what could be the issue or how to get the exact error code/detailed description?
This issue is occurring at the Production domain.
The rtc0 file has a soft link as shown in the attached file.
Please find the snippet of the code below:
int fd, retval;
fd = open("/dev/rtc0", O_RDWR);
if(fd < 0)
{
printf("unable to open");
}
/* Read the RTC time/date */
retval = ioctl(fd, RTC_RD_TIME, &rt);
if (retval == -1) {
printf("RTC_RD_TIME ioctl error");
}
close(fd);

0 Kudos
0 Replies