Unpredictable behaviour when using RTWDOG on RT1021

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unpredictable behaviour when using RTWDOG on RT1021

803 Views
mahesh3
Contributor III

Hello,

I am trying to use the RTWDOG peripheral in one of my projects which also uses FreeRTOS.
I am attaching a demo where I have modified the FreeRTOS hello_world example. I am running it on the EVKIT.

What I observe is while configuring the RTWDOG peripheral if config.workMode.enableDebug = false; a WDT Reset is not triggered. When I watch RTDWOG->CS register in the debugger I notice that the watchdog doesn't start and my configuration is not applied to the register.

When config.workMode.enableDebug = true; the WDT starts and the core gets reset if WDT is not refreshed. But if I upload the same binary using the NXP-MCUBootUtility, then a WDT reset is not triggered.

Please have a look at my attached example program.
I am using MCUXpresso, SDK Version 2.7.0, Debugger: J-Link.

Regards,

Mahesh Murty

Labels (1)
0 Kudos
3 Replies

775 Views
mahesh3
Contributor III

Hi @victorjimenez,

I noticed the note you have mentioned above in the user manual and also I saw the delay in the rtwdog example.
I have placed that delay initially in the above uploaded program but still the outcome did not change so may be I have removed it later.
Before posting here I did check the rtwdog example which was working fine in all the scenarios.
I was facing issues with my application and hence I created a new freertos_hello_world example to test the rtwdog behaviour.
The uploaded example and my application behave in a similar manner.

So can you please have a look at the uploaded example and let me know if I am missing something. Does the above example behave correctly when you upload it on the EVKIT?

Thanks & Regards,
Mahesh Murty

0 Kudos

752 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Mahesh Murty,

I checked your example, and I didn't see your delay. Please be aware of the following note in the reference manual. 

victorjimenez_0-1625876628105.png

In your application, after you activate the clock, you didn't add any type of delay. 

victorjimenez_1-1625876694006.png

In the SDK example project, after activating the clock, we add the delay. For instance, the clock is activated within the main function. 

victorjimenez_2-1625876905047.png

After activating the clock, we jump into the function RTWdogFastTesting. Inside this function, before start configuring the RTWDOG, there's a delay. I wasn't able to see this delay or an equivalent in your application. 

victorjimenez_3-1625877001655.png

Regards,
Victor 

0 Kudos

789 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Mahesh Murty, 

I made some tests on my end. I wasn't able to replicate the behavior that you mentioned. For my tests, I used the rtwdog example that we provide within the SDK. In this project, we configure the enableDebug as false, and the application runs without problems during the debug session. Are you aware of the following note in the reference manual? 

victorjimenez_0-1624987773808.png

This is why in the SDK example, we add a delay before configuring the RTWDOG registers. Did you add this to your application? I highly recommend you check this project to see if you are missing any configuration on your application. 

Regards,
Victor 

 

0 Kudos