K60 can't disable watchdog when running from external code memory

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

K60 can't disable watchdog when running from external code memory

Contributor I

I'm running code  on a K60FX12VLQ12 in external flash memory through the aliased region of memory.  I'm trying to run a demo program and it resets when running the wdog_disable function (it unlocks the the watchdog then clears the wdog enable bit in the control register).  I see in the comments that you can't single step through this code because it has to finish within 20 clock cycles.

If I run the code in internal RAM or FLASH, it gets by the wdog_disable function every time. When I run the code in external flash it resets before it gets past this section of code.  I tried lowering the waitstates from 4 to 2 and it still would reset before making it through.

Does the code run too slow in external flash to disable the watchdog? 

I'm using IAR Workbench and did some tests using the CYCLECOUNTER value in the debugger with different builds.  I set a breakpoint early in the bootcode where the wdog_disable function is called.  I ran the code until it hit the breakpoint and recorded the CYCLECOUNTER for each memory type.

Code Memory              CYCLECOUNTS

Internal RAM                 19

Internal FLASH              23

External FLASH             574

**Incidentally, when I single step through the code it takes 18 counts no matter where the code is running. Does that have to do with the type of breakpoint?



Labels (1)
Tags (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Please try to enable the code cache at Local Memory Controller for Flexbus of K60FX12VLQ12.

With the code cache enable, the code execute in external Flash (Flexbus) performance will be enhanced.

Wish it helps.
best regards
Ma Hui

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

0 Kudos