How to sync RTC date and time with OSD

Hi,

I tried OSD example available at GitHub - Ameba-AIoT/ameba-rtos-pro2: Realtek Official IoT Software Development Kit for Ameba Series SoC: (Ameba Pro2)

I found that the date and time are epoch time (1970-01-01 ….) and need to change it, so I called RTC functions as below before calling OSD functions, but still OSD displaying epoch time.

rtc_init();

rtc_write(1256729737);  // Set RTC time to Wed, 28 Oct 2009 11:35:37

I tried by calling below OSD functions also, but still epoch time only apperaring.

void rts_osd_isp_refresh_datetime(void);

enum rts_osd_err_code rts_osd2_set_time(int hour, int minute, int seconds);

enum rts_osd_err_code rts_osd2_set_date(int year, int month, int day);

Is anyone achieved OSD with different time than epoch time?

Thanks,

Yugandhar

Hi @yugandhar

You can consider using NTP Client.

Hi @pammyleong

Thanks for your suggestion, I am not asking about present date and time capture in Ameba board. I will get it from camera NVR and able to set with RTC module and when I read back also getting correct time, but the OSD module not using this time, still the date and time OSDs are showing epoch time. After calling rtc_write() I am calling below functions,but still all date and time OSDs are displayed with epoch time only. How to achieve the RTC module’s date and time in OSDs alos?

void rts_osd_isp_refresh_datetime(void);

enum rts_osd_err_code rts_osd2_set_time(int hour, int minute, int seconds);

enum rts_osd_err_code rts_osd2_set_date(int year, int month, int da