Other Parts Discussed in Thread: HALCOGEN,
Explain how to create NMI interrupt and RESET generation using digital watchdog in the case of failed to feed the watchdog!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Explain how to create NMI interrupt and RESET generation using digital watchdog in the case of failed to feed the watchdog!
1. NMI Interrupt:
Actually, there is an example in HALCoGen for this use case. But there is one small mistake in this code.,
Here in this example, you can see they are enabling IRQ interrupt right, but the problem is watchdog NMI is not IRQ interrupt it is a FIQ interrupt.
You can see NMI interrupt is on Interrupt channel-0
And watchdog NMI interrupt will be coming into the ESM2.24 channel. So, whenever watchdog time expires you will get "esmHighInterrupt" with ESM2.24 channel SET.
But you can see this ESM High interrupt is an FIQ interrupt:
So, here we should enable the FIQ interrupt then only NMI interrupt will get generated whenever watchdog will fail to feed.
So, you can see i am calling _enable_interrupt_ instead of _enable_IRQ to enable both IRQ and FIQ interrupts.
And here is the tested project on TMS570LC4357 Launchpad:
2. Watchdog RESET:
With little changes to above code, we can create the code for RESET instead of NMI generation:
But this RESET generation have also couple of issues:
i) Watchdog RESET will work only one time and after first watchdog RESET it won't work properly (I mean interrupts will not create, so that means feeding will not happen on second time onwards)
ii) On HDK board "EXTRST" flag will not get SET after watchdog RESET and only "WDRST" will get SET but whereas on launchpad both the resets will SET.
The root cause for above problems explained in below thread and also necessary workarounds suggested for the two problems: