After updating components of an old project, a watchdog error appeared.

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

cross mob
AdamsChengTW
Level 3
Level 3
10 sign-ins 5 sign-ins 10 questions asked

Hi

After updating the components of my old project, the WDT  part of the code shows an error. What are these parts replaced by?

PSoC Creator 4.4
Global Signal 2.10.

 

ChHs_4614611_0-1683533502022.png

 

0 Likes
1 Solution
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 
You can use Custom ISR, it would be same with your last project. 
After you setup the WDT through the Configure System Clock,  you  need to add the ISR and Global Signal components to your schematic:

Andrisetyabudi_0-1683818251994.png

and choose Watch Dog Timer interrupt for the Global signal name.

Andrisetyabudi_1-1683818351853.png

This will attach the WDT Interrupt Signal to the NVIC. 
Then passed your  handler function to the Custom_ISR after that call the CySysWdtUnmaskInterrupt()

 WDT_isr_StartEx(WDTTimer_Interrupt);  // i set the name of Global Signal as WDT_isr

 CySysWdtUnmaskInterrupt();

 

warm regards, 

View solution in original post

11 Replies
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 

Could you please describe the errors with more detail ? 
it looks like there is missing a reference ( library ). 
Have you re-generate the application before build it ? 

Warm regards, 

0 Likes

HI,

This project is already a product that has been put into mass production. I am using it as a base to modify it for other products.
I've regenerated the code, but there are still errors in these places. It seems like some files or functionality are missing and need to be updated.

ChHs_4614611_0-1683611703985.png

 

 

0 Likes

Hi, 

It seems like your project using SRS-Lite from CyLFClk.h header file instead of SRSSv2.
You can refer to  the documentation of cy_lfvlk_v1_20

Which PSoC  do you use in that Project ? 

Warm regards

0 Likes

Hi,
The old project was used in a smart door lock. The new project will focus on creating a simple touch module. The watchdog timer will be used with Capsense to detect when there is no touch input and enter sleep mode to achieve power savings. The MCU will be awakened by the WDT to resume operation.

0 Likes

Hi, 


Can you describe the kind of PSoC do you use in your project ? 
or can you share the project so I can help to review it ? 

The PSoC included 1 WDT has different API function than PSoC included more than 1 WDT.
for example,
This function in PSoC 4100PS series ( only has 1 WDT )  CySysWdtSetMatch(uint32 match);
but in PSoC 4200 is CySysWdtSetMatch(uint32 counterNum, uint32 match);

Refer to CyLFClk.h for which function can be used/accessed in your project.
Because PSoC creator will build different cytypes.h for different PSoC series.. 
Could you check in Low Frequency clock, how much the WDT( Timer ) inside your project ?  

Andrisetyabudi_0-1683625994490.png

 

Warm regards,

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

Hi, 
My project uses CY8C4125LQI-S433, and the low frequency clock is set up as shown in the diagram you provided.

I referred to CyLFClk.h and made some modifications to the previously problematic part. Currently, there are no errors. However, I haven't had the chance to test it on the CY8C4125LQI-S433 board yet, so I'm not sure if the modifications are correct.

I do have a CY8CKIT-145-40XX prototyping kit available, so I'll use that to test it out first.

I've attached the complete project for your reference.

ChHs_4614611_0-1683683538955.png

 

0 Likes
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 

After see your project,  
I found your WDT block in the project gives the wrong information. 
CY8C4125LQI-S433 should be like this with only has 1 WDT and 3 timers

Andrisetyabudi_0-1683702294892.png

but from your project are different, your Design Wide Resource (*.cydwr) gaves wrong information. 

Andrisetyabudi_1-1683702539063.png

The clock source are different. WDT will use LFClk as the clock source.  
did you use different PSoC before and change to CY8C4125LQI-S433

I referred to CyLFClk.h and made some modifications to the previously problematic part. Currently, there are no errors. However, I haven't had the chance to test it on the CY8C4125LQI-S433 board yet, so I'm not sure if the modifications are correct.

I don't recommend to you  to modify the API or library, since WDT will use LFClk as the clock source. 

From your file there is a project with CY8C4125LQI-483 and CY8C4125LQI-S433 as the selected device, both of them has different block diagram in clock-source.

If you have a plan to test it on CY8CKIT-145-40XX ( uses CY8C4045AZI-S413), i'm not sure if it will work properly since  they differ architecturally

Warm regards, 

Hi, 
The current project has been modified from CY8C4125LQI-483 to CY8C4125LQI-S433.

I am currently testing the watchdog functionality using the CY8CKIT-145-40XXX board.

I want the watchdog to generate an interrupt instead of a reset.

However, I have been unsuccessful so far. I have enabled the timer (WDT) and set the mode to watchdog with interrupt. In the main() function, I have added the line CySysWdtSetInterruptCallback(WDTTimer_Interrupt); and created the interrupt function WDTTimer_Interrupt.

The watchdog still keeps resetting the MCU instead of executing the interrupt. What could be the problem?

ChHs_4614611_0-1683794348644.png

ChHs_4614611_1-1683794455346.png

ChHs_4614611_2-1683794487214.png

 

0 Likes
Andri-setyabudi
Level 5
Level 5
50 likes received 50 sign-ins 25 solutions authored

Hi, 
You can use Custom ISR, it would be same with your last project. 
After you setup the WDT through the Configure System Clock,  you  need to add the ISR and Global Signal components to your schematic:

Andrisetyabudi_0-1683818251994.png

and choose Watch Dog Timer interrupt for the Global signal name.

Andrisetyabudi_1-1683818351853.png

This will attach the WDT Interrupt Signal to the NVIC. 
Then passed your  handler function to the Custom_ISR after that call the CySysWdtUnmaskInterrupt()

 WDT_isr_StartEx(WDTTimer_Interrupt);  // i set the name of Global Signal as WDT_isr

 CySysWdtUnmaskInterrupt();

 

warm regards, 

HI,
Thank you for your assistance. Following your guidance, the WDT is now functioning correctly according to my requirements.

Once my new board is completed, I will apply the same approach to see if it works properly.

Hi, 
Nice... 
Let us know if you face another issue.. 
😊

Warm regards,