KDS project loops in WatchDog ISR

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

KDS project loops in WatchDog ISR

1,035 Views
vladav
Contributor I

Hello Everyone,

 

    I tried two projects - hello_world (..\Freescale\KSDK_1.0.0\demos\hello_world\kds\frdmk64f120m)- and my test project created according to KDS User Guide.

  Both codes give the same results - MCU registers can be read but the software loops in WatchDog ISR endlessly and never goes to main().

 

Here are some more details:

the software endlessly loops in

>> Watchdog_IRQHandler:

>> 00000568: b.n 0x568<Watchdog_IRQHandler>

>> 0000056a: nop

and never jumps to main().

 

Thank you for any suggestions,

Vlad.

Labels (1)
Tags (1)
0 Kudos
5 Replies

485 Views
adriancano
NXP Employee
NXP Employee

Hi Vladimir,

Do you have any news about this issue??

Best regards,

Adrian

0 Kudos

485 Views
adriancano
NXP Employee
NXP Employee

Hi,

Did you try the Alice's code? Do you have any progress on this?

Please let me know.

Kind regards,

Adrian

0 Kudos

485 Views
DavidS
NXP Employee
NXP Employee

Hi Adrian,

Yes I tried Alice's code.  Her code is fine to demonstrate the WDOG timeout will reset the device.  I too can do this.

What I have not been able to demonstrate is having the WDOG ISR routine be called before the device gets reset.

Recall the WDOG section 24.2 in the K64RM:

Configurable interrupt on time-out to provide debug breadcrumbs. This is followed

by a reset after 256 bus clock cycles.

I have tried setting breakpoint on first instruction but it never hits.  I have tried including assembly code to break/halt the processor.  But the only result I get is resetting of the device and never seem to get into the WDOG ISR.

The wdog_reset_frdmk64f120m project has been setup to have the Watchdog_IRQHandler in the vector table so there is sufficient time to get into the ISR before the 256 bus clocks expire.

With my MQX testing I think the 256 bus clocks expire before getting out of the kernel ISR so I will re-test that with the WDOG ISR directly in the vector table.

I will let you know my results.....

Results: Even using MQX and placing the WDOG ISR in the vector table and trying every trick in the book to halt/stop/breakpoint in the ISR first instruction I cannot ever see the WDOG ISR being called.  I call uncle now (i.e. I give up).

Regards,

David

0 Kudos

485 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Vlad,

Here is a demo I just run successfully   about frdmk64f120m on KDS 1.1.0 -KSDK 1.0.0,     its a LED damo.   You can try.

Best Regards,

Alice

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you for your support to us!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

485 Views
DavidS
NXP Employee
NXP Employee

Hi Alice, et al.,

I have been working with the KDS1.1.1+KSDK1.0.0 wdog_reset_frdmk64f120m example.

It does a good job of resetting the device when the WDOG times out do to lack of refresh (i.e. kicking the dog).

What I seem to not be able to do is generate a watchdog ISR.

After setting up the NVIC and WDOG to enable interrupt, I can issue a software generated interrupt to the WDOG isr using the STIR register.

But I cannot every see the WDOG isr fire.  But I do get a device reset.

If you or anyone else would like to play with the project, I'm attaching it with extra files I modified in the platform code to allow software to configure the WDOG for interrupt mode (it was hard coded to have WDOG interrupt disabled).

Here are notes I took as well.

Looking at the ksdk_platform_lib_K64F12 project the system_MK64F12.h header has the following at line 100:
#define DISABLE_WDOG 1    //DES 1=WDOG is disabled, 0=WDOG is enabled.  WDOG can be enabled in application code to over ride this setting.

Also in the platform code is fsl_wdog_driver.c that by default sets the WDOG interrupt to the disabled state at line 107.
wdogCommonConfig.commonConfig.interruptEnable = (uint8_t)false;  //DES not sure why this is hard-coded this way...

In the hello_world_frdmk64f120m example code the system_MK64F12.c has code to disable the WDOG based on the DISABLE_WDOG #define.


Lastly, with the DISABLE_WDOG in the default state, I was able to load the wdog_reset_frdmk64f120m project without any issue.  Then I noticed that it is not using the WDOG interrupt.
I've updated my line 107 code above with the following to allow my application to control the interrupt enable rather than have it hard-coded.
wdogCommonConfig.commonConfig.interruptEnable = (uint8_t)false;  //DES not sure why this is hard-coded this way...

I've also tried getting the WDOG ISR to fire in MQX for TWR-K60D100M and TWR-K70F120M unsuccessfully.

Regards,

David

0 Kudos