I'm using an MKL26Z128 and cannot seem to enable the COP (watchdog). I can get it to work on the FRDM board that I have by commenting out the SIM_COPC = 0x00 line in the start() function. If I comment out the same line of code for the custom board it has no effect, COP is always disabled. I've searched the code for any reference to SIM_COPC and the line in start() is the only one I find. I'm using IAR Embedded Workbench. Is there some setting in the IAR tool that I may have missed that would cause this behavior. It acts as if the SIM_COPC register is being written to, one time write after reset, but I can't seem to locate where that might be happening.
解決済! 解決策の投稿を見る。
Hello Paul Hoffmeyer:
If you are debugging then be aware that some interface debugger scripts disable the Watchdog when connecting, before letting the MCU run anything in your code. Try running the code in standalone mode (no debugger) and see if the watchdog is enabled AFTER a reset. Also if you have a different debug interface at hand (e.g. Universal Multilink) try with that one.
Finally, I guess it is not your case, but if you had a bootloader then the watchdog should not be disabled in the bootloader if the application is supposed to use it.
Regards!
Jorge Gonzalez
Hello Paul Hoffmeyer:
If you are debugging then be aware that some interface debugger scripts disable the Watchdog when connecting, before letting the MCU run anything in your code. Try running the code in standalone mode (no debugger) and see if the watchdog is enabled AFTER a reset. Also if you have a different debug interface at hand (e.g. Universal Multilink) try with that one.
Finally, I guess it is not your case, but if you had a bootloader then the watchdog should not be disabled in the bootloader if the application is supposed to use it.
Regards!
Jorge Gonzalez
Hello Jorge Gonzalez,
I should have mentioned I had tried several times last week with and without the debugger, Segger jlink, and with debug and release build settings. I decided to give it one more try this morning before I posted a response here and now it works without the debugger. I had made no changes other then to comment out the SIM_COPC line in start() and clean, rebuild and load which I had tried numerous times last week. Thanks for your help.
Regards
Paul Hoffmeyer