RTC Reset to Default Value after resetting the module.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AkJa_4647796
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello AnjanaM_61​,

I am using internal RTC with external crystal oscillator (32khz) in CYBT-413034-02 module. Every time i reset my module (power on and off),

The RTC time gets to its default time ie January 1, 2010 with a time of 00:00:00 denoting HH: MM: SS.  Below is the api  which i have use?

Is anything missing which i forgot to configure?

for eg with external RTC DS1307 which has an VBAT pin through which we supply continous power so it keeps going? is there any option in CYBT-413430 to maintain RTC data?

#include "rtc.h"

//this is included in application_init()

RtcTime time_date;                                                                        

rtcConfig.oscillatorFrequencykHz = RTC_REF_CLOCK_SRC_32KHZ

rtcConfig.rtcRefClock = RTC_REF_CLOCK_SRC_32KHZ;

rtc_init();

//reads every 1 sec.

rtc_getRTCTime(&time_date);

Thank You.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Update:

tested the code (test2_rtc.zip ) . I was able to reproduce the issue. The timings where not getting updated correctly and was constant after some time.

However when I tested replacing the patches , as I mentioned in  previous response. Time increment is correct. Attached the patch folder to avoid confusion. Please use (replace the patch folder) this patch attached and copy to folder location C:\Users\...\Documents\WICED-Studio-6.4-broad\20719-B1_Bluetooth\WICED\internal\20719B1

Please do clean (from make target ) first before build and download the code. If you skip clean step, there is chance SDK may not take new patch files.

If still you are facing issue, I suspect your 32K crystal connected is not running correctly. Please refer the 32K connection in 20719B1 EVAL schematics (https://www.cypress.com/documentation/development-kitsboards/cyw920719q40evb-01-evaluation-kit)

Please Note:

1. As I don't have a setup directly to test CYBT-413034-02 module connected with 32K crystal , I used CYW20719B1 EVAL board to simulate this issue & confirm the fix.

2. As this is an internal RTC , this may not be very accurate & there is limitation as when you reset the RTC will restart. So I would suggest you to use external RTC IC if timings are critical for your application.

Thanks & Regards,

Anjana

View solution in original post

0 Likes
13 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi AkJa_4647796 ,

If you reset the device , RTC values will be lost. There is no separate backup domain available for now.

Sorry for the inconvenience caused for you.

Regards,

Anjana

Hello AnjanaM_61​,

Is there any sample code for RTC in CYBT-413034?

whenever i try to connect CYSMART  app (mobile app), the RTC start increasing by 5 sec after some point it shows only one fixed time?

what can be the error?

Thank You.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi AkJa_4647796 ,

Attached is a generic RTC example for 20719. You may refer the same.

whenever i try to connect CYSMART  app (mobile app), the RTC start increasing by 5 sec after some point it shows only one fixed time?

what can be the error?

=> Not sure what could be the issue. Could be specific to the application implementation . Are you using any low power mode?

Regards,

Anjana

Hello AnjanaM_61​,

I am not using any Low Power Mode. I have included RTC code in hello_sensor demo code and reading rtc value on Putty using HCI uart.

Thank You.

0 Likes

Hi AkJa_4647796 ,

OK. I would suggest you to recheck the implementation comparing the reference project.

Please let us know if it still showing a fixed time. If then , please share the code to reproduce at our side.

Regards,

Anjana

0 Likes
lock attach
Attachments are accessible only for community members.

Hello AnjanaM_61​,

Attaching my code.

Thank You.

0 Likes

Hello AnjanaM_61​,

Have you implemented the code at your side?

Thank You.

0 Likes

Hello AnjanaM_61​,

I am using an 32 khz external oscillator, do i need to set this clock_frequency in my cod using api? or  The firmware decides which clock source to use among the available LPOs depending on the accuracy and power requirements.

THANK YOU.

0 Likes

Hi AkJa_4647796 ,

Sorry for delay in response.

if you are using CYBT-413034-02  in WICED 6.4 without the patches given here: Platform and New Patch Files For 20719B1 in WICED 6.4.0.61 - KBA228518  , then by default the FW enables / uses external 32K (Make sure the crystal meets the specifications needed)

If you use the patches in KBA, then the module will be using internal 32K

Regards,

Anjana

Hello AnjanaM_61​,

Yes, I am using CYBT-413034-02  in WICED 6.4 with the patches given here: Platform and New Patch Files For 20719B1 in WICED 6.4.0.61 - KBA228518.

Because if i don't use patches i am not able to download the code to  CYBT-413034-02. In previous discussion you have mentioned to use this patch files. Any other solution? how can i make my module to use external 32khz crystal oscillator.

Thank You.

0 Likes

Hi AkJa_4647796 ,

Let me check if there is any other way and update you.

Regards,
Anjana

Thank You AnjanaM_61​.

0 Likes
lock attach
Attachments are accessible only for community members.

Update:

tested the code (test2_rtc.zip ) . I was able to reproduce the issue. The timings where not getting updated correctly and was constant after some time.

However when I tested replacing the patches , as I mentioned in  previous response. Time increment is correct. Attached the patch folder to avoid confusion. Please use (replace the patch folder) this patch attached and copy to folder location C:\Users\...\Documents\WICED-Studio-6.4-broad\20719-B1_Bluetooth\WICED\internal\20719B1

Please do clean (from make target ) first before build and download the code. If you skip clean step, there is chance SDK may not take new patch files.

If still you are facing issue, I suspect your 32K crystal connected is not running correctly. Please refer the 32K connection in 20719B1 EVAL schematics (https://www.cypress.com/documentation/development-kitsboards/cyw920719q40evb-01-evaluation-kit)

Please Note:

1. As I don't have a setup directly to test CYBT-413034-02 module connected with 32K crystal , I used CYW20719B1 EVAL board to simulate this issue & confirm the fix.

2. As this is an internal RTC , this may not be very accurate & there is limitation as when you reset the RTC will restart. So I would suggest you to use external RTC IC if timings are critical for your application.

Thanks & Regards,

Anjana

0 Likes