cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Bluetooth

daba_4649501
New Contributor II

Hello,

i am using CYBT-413055-02 bluetooth module and i was wondering whether the module has the internal RTC or not.

i can able to find the API calls in the stack in rtc.h. if RTC can be configured please provide a test code.

regards,

Danny.

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator

Hi daba_4649501 ,

Thanks for your patience.

Seems like you have to configure rtcConfig in the application before rtc init

rtcConfig.rtcRefClock = RTC_REF_CLOCK_SRC_32KHZ;

rtcConfig.oscillatorFrequencykHz = RTC_REF_CLOCK_SRC_32KHZ;

However to avoid undefined reference error, please include the below line to C:\Users\anpm\ModusToolbox_2.1\wiced_btsdk\dev-kit\baselib\20719B2\internal\20719B2\patches\patch.sym

rtcConfig = 0x201b21; 

From next BTSDK version, this will be added in the patch symbols by default. Sorry for the inconvenience.

Please make this change and clean and build both wiced_btsdk and application .

This should work.

Regards,
Anjana

View solution in original post

0 Likes
6 Replies
AnjanaM_61
Moderator
Moderator

Hello,

Please have a look at the demo attached corresponding to CYW20719B1 in WICED.

You can use the same logic for 20719B2 in MTB.

Please note if you reset the device / power cycle , RTC will reset to the default value. There is no back up available.

You may also refer the implementation available here: CypressAcademy_WBT101_Files/Projects/ch02/key_ch02_ex13_rtc at master · cypresssemiconductorco/Cypre...

Regards,

Anjana

0 Likes
daba_4649501
New Contributor II

Hello anjana,

thanks for your response, i am getting an undefined reference error while linking the program and this is not an compiler error using these lines

        rtcConfig.rtcRefClock = RTC_REF_CLOCK_SRC_32KHZ;

        rtcConfig.oscillatorFrequencykHz = RTC_REF_CLOCK_SRC_32KHZ;

i have included rtc.h file in the stack, i dont know why i am getting with error, but when i comment those specified lines, i can able to run the RTC and able to print the seconds but its very slow, ik we need to activate the 32khz crystal to intialize accurate RTC.

please clarify undefined error, i have tried to extern the structure variable, still no use.

Thanks and Regards,

Danny.AnjanaM_61

0 Likes
AnjanaM_61
Moderator
Moderator

Hi daba_4649501 ,

You need not have to do that step in latest MTB

      rtcConfig.rtcRefClock = RTC_REF_CLOCK_SRC_32KHZ;

        rtcConfig.oscillatorFrequencykHz = RTC_REF_CLOCK_SRC_32KHZ;

This was needed while using WICED SDK old versions

Regards,

Anjana

0 Likes
daba_4649501
New Contributor II

hello AnjanaM_61,

thanks for your response,

i have commented those line and ran the code but the RTC seconds update only happens at 3 seconds once.

like for one second update, i have to wait three seconds for the next second update.

please help me to sync the RTC seconds response and resolve this issue.

thanks and regards,

danny.

0 Likes
AnjanaM_61
Moderator
Moderator

Hi daba_4649501 ,

Thanks for your patience.

Seems like you have to configure rtcConfig in the application before rtc init

rtcConfig.rtcRefClock = RTC_REF_CLOCK_SRC_32KHZ;

rtcConfig.oscillatorFrequencykHz = RTC_REF_CLOCK_SRC_32KHZ;

However to avoid undefined reference error, please include the below line to C:\Users\anpm\ModusToolbox_2.1\wiced_btsdk\dev-kit\baselib\20719B2\internal\20719B2\patches\patch.sym

rtcConfig = 0x201b21; 

From next BTSDK version, this will be added in the patch symbols by default. Sorry for the inconvenience.

Please make this change and clean and build both wiced_btsdk and application .

This should work.

Regards,
Anjana

View solution in original post

0 Likes
daba_4649501
New Contributor II

Hello AnjanaM_61

thanks for your reply,

i will try your solution and let you know. ASAP

thanks and regards,

Danny.

0 Likes