Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

SMD_4782786
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi all,

Not able to enable watchdog in cy8c4025azi-s413.

same code is working in cy8c4245axi-483.

CODE in cy8c4245axi-483 :

//watch dog initialization(2 second)
/* Set the second WDT counter to generate reset on match */
CySysWdtWriteMode(CY_SYS_WDT_COUNTER1, CY_SYS_WDT_MODE_RESET);
CySysWdtWriteMatch(CY_SYS_WDT_COUNTER1, 0xFA00);

/* Counter 1 is cleared when there is match */
CySysWdtWriteClearOnMatch(CY_SYS_WDT_COUNTER1, 1u);

/* Counter 1 is enabled */
CySysWdtEnable(CY_SYS_WDT_COUNTER1_MASK);

 

for(;;){

CySysWatchdogFeed(CY_SYS_WDT_COUNTER1);

}

same code is not working in cy8c4025azi-s413.

what to do ?

 

Thank you

0 Likes
1 Solution
Ekta
Moderator
Moderator
Moderator
250 solutions authored 100 likes received 250 sign-ins

Hello @SMD_4782786 ,

You are observing the errors in case of  cy8c4025axi-s413 because it does not have the same set of functions for WDT as cy8c4245axi-483. The error "undefined reference to CySysWatchdogfeed" is because this function does not exist for the cy8c4025axi-s413 (psoc 4000s family).

You can refer code example on watchdog timer for 4000S device at this link to get an idea of how the Watchdog timer is setup for the 4000s device : https://www.cypress.com/documentation/code-examples/ce210292-psoc-4s-watchdog-timer

The following Appnote will help you understand the differences in the WDT of both the 4200 and 4000S device:
https://www.cypress.com/file/369061/download

You can also refer to the to the Watchdog Timer section of the Architecture TRM of both the 4200 and 4000S devices.

The CyLFClk.c file in your project will contain the WDT APIs that are supported by each of the devices. Refer to the non-greyed out APIs in both case.

I hope this helps you understand why you are observing these errors when using the same set of APIs.

Thanks and Regards

Ekta

View solution in original post

0 Likes
1 Reply
Ekta
Moderator
Moderator
Moderator
250 solutions authored 100 likes received 250 sign-ins

Hello @SMD_4782786 ,

You are observing the errors in case of  cy8c4025axi-s413 because it does not have the same set of functions for WDT as cy8c4245axi-483. The error "undefined reference to CySysWatchdogfeed" is because this function does not exist for the cy8c4025axi-s413 (psoc 4000s family).

You can refer code example on watchdog timer for 4000S device at this link to get an idea of how the Watchdog timer is setup for the 4000s device : https://www.cypress.com/documentation/code-examples/ce210292-psoc-4s-watchdog-timer

The following Appnote will help you understand the differences in the WDT of both the 4200 and 4000S device:
https://www.cypress.com/file/369061/download

You can also refer to the to the Watchdog Timer section of the Architecture TRM of both the 4200 and 4000S devices.

The CyLFClk.c file in your project will contain the WDT APIs that are supported by each of the devices. Refer to the non-greyed out APIs in both case.

I hope this helps you understand why you are observing these errors when using the same set of APIs.

Thanks and Regards

Ekta

0 Likes