WDT interrupt not triggered on CM0+

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

cross mob
vinu_gk
Level 3
Level 3
50 sign-ins First solution authored 10 replies posted

Hi,

I want to run watchdog timer in interrupt mode in PSOC 6 CM0+ core. I referred and copied the CM4 WDT examples and ported the code for CM0 core. However, i am unable to WDT interrupt or MCWDT interrupt. 

I even tried the WDT workaround below, but of no success:

Workaround for PSoC 6 MCU Device ILO Start Failure in PSoC Creator 4.2 – KBA229046

Please note that i am using :

  • CY8CKIT-062-WiFi-BT PSoC 6 WiFi-BT Pioneer Kit 1.0 Rev.**
  • Peripheral Driver Library 3.0.1
  • PSoC Creator 4.2

best regards,

Vinu

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @vinu_gk 

 

You need to configure the interrupts for the CM0p core with an additional cm0psource as well.

const cy_stc_sysint_t mcwdt_int_cfg = {
    .intrsrc=(IRQn_Type) NvicMux7_IRQn,
    .cm0psrc=srss_interrupt_mcwdt_0_IRQn,
    .intrPriority = 2
};

 

I am attaching a sample code that shows MCWDT interrupt with CM0p. Please try this and let me know if you have any further queries. 

 

Best regards, 
Hari

View solution in original post

7 Replies
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @vinu_gk 

 

You need to configure the interrupts for the CM0p core with an additional cm0psource as well.

const cy_stc_sysint_t mcwdt_int_cfg = {
    .intrsrc=(IRQn_Type) NvicMux7_IRQn,
    .cm0psrc=srss_interrupt_mcwdt_0_IRQn,
    .intrPriority = 2
};

 

I am attaching a sample code that shows MCWDT interrupt with CM0p. Please try this and let me know if you have any further queries. 

 

Best regards, 
Hari

vinu_gk
Level 3
Level 3
50 sign-ins First solution authored 10 replies posted

Thanks Hari. I will check it and update you.

BTW, i found these defines in cyfitter_sysint_config.c file. Can we make use of these defines ? 

cm0-isr-defines.JPG

regards,

Vinu

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @vinu_gk 

 

You can make use of similar interrupt config structures. The main.c attached in my previous response shows a similar approach in defining the WDT interrupts. 

 

Best regards, 
Hari

vinu_gk
Level 3
Level 3
50 sign-ins First solution authored 10 replies posted

Hi Hari,

The WDT interrupt triggered when i commented the following line in main_cm0p.c :

Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);

 

I couldn't figure out the reason. Can you please check what i am missing here ?

regards,

Vinu

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @vinu_gk 

 

That line enables the CM4 core for execution. Commenting that line of code prevents the CM4 from starting and the PSoC device works as a single core device. 
You would still need to configure the interrupts correctly for the WDT to trigger in CM0p. Can you please share your project so that I can take a look?

 

Thanks, 
Hari

vinu_gk
Level 3
Level 3
50 sign-ins First solution authored 10 replies posted

Hi @Hari ,

I think MCWDT interrupt worked when i added this line :

NVIC_ClearPendingIRQ((IRQn_Type) VALVE_MCWDT_ISR_cfg.intrSrc);

thanks!

0 Likes
lock attach
Attachments are accessible only for community members.
vinu_gk
Level 3
Level 3
50 sign-ins First solution authored 10 replies posted

Hi Hari,

Please see the attached project. The red LED blinks every 1 second using WDT interrupt.

regards,

Vinu

0 Likes