<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis MicrocontrollersのトピックRe: Unable to write to COP</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024314#M56337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not see that line for the watchdog in the settings so I wrote it in, but it solved all of my issues.&amp;nbsp; I guess commenting out the line in code is not the same :smileyhappy:.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2020 16:44:20 GMT</pubDate>
    <dc:creator>umlengineer</dc:creator>
    <dc:date>2020-04-08T16:44:20Z</dc:date>
    <item>
      <title>Unable to write to COP</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024310#M56333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement a watchdog timer in my code, and I think the register is being addressed before I use the init function, but I can not find where.&amp;nbsp; I was able to find the disable in the system_MKL17Z644.h file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#ifndef DISABLE_WDOG&lt;BR /&gt;&amp;nbsp; #define DISABLE_WDOG&amp;nbsp; 0&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when I set the define to 0 I get a working watchdog timer, but not with the settings that I am sending.&amp;nbsp; I am trying to set the debug bit, and the long timeout bits as I would like as long of a timeout as I can set to start with, but when I read the register after I write to it, I only see that COPT has been set to 11, all other bits are 0.&amp;nbsp; This is read through a PE Micro debugger.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, here is a sample of what i cam doing to enable the COP, my actual code is way to big to just paste in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "fsl_cop.h"&lt;BR /&gt;#include "fsl_rcm.h"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cop_config_t configCop;&lt;/P&gt;&lt;P&gt;COP_GetDefaultConfig(&amp;amp;configCop);&amp;nbsp; //Here is where I setup the long delay and debug bits&lt;/P&gt;&lt;P&gt;COP_Init(SIM, &amp;amp;configCop);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No matter when I check the register, I see the same settings, that is at the top of main, right before and right after the init().&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas as to what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2020 18:36:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024310#M56333</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2020-03-26T18:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write to COP</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024311#M56334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="307381" data-username="umlengineer" href="https://community.nxp.com/people/umlengineer"&gt;Evan Griffith&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the sdk example I suggest you set the macro DISABLE_WDOG to 1. Also please check that the macro FSL_FEATURE_COP_HAS_LONGTIME_MODE is 1. Those 2 macros are very important for the COP init. You can find these macros at "MKL17644_features.h"&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/101051iA22B3411AB2C58BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding your sample code it is well defined, in the example we make a verification before init the cop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt; cop_config_t configCop;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COP_GetDefaultConfig(&amp;amp;configCop);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Check if WDOG reset occurred */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (RCM_GetPreviousResetSources(RCM) &amp;amp; kRCM_SourceWdog)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("Reset due to COP timeout\r\n");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COP_Disable(SIM);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("COP example ends!\r\n");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* If WDOG reset is not occurred, enables COP */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\nCOP example start!\r\n");&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COP_Init(SIM, &amp;amp;configCop);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this, you can call the function COP_Refresh() to feed the dog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Omar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 20:47:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024311#M56334</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2020-03-31T20:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write to COP</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024312#M56335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me, but I am still confused.&amp;nbsp; If I disable the COP in the system_MKL17Z644, it runs this line of code I think:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#if (DISABLE_WDOG)&lt;BR /&gt;&amp;nbsp; /* SIM-&amp;gt;COPC: ?=0,COPCLKSEL=0,COPDBGEN=0,COPSTPEN=0,COPT=0,COPCLKS=0,COPW=0 */&lt;BR /&gt;&amp;nbsp; SIM-&amp;gt;COPC = (uint32_t)0x00u;&lt;BR /&gt;#endif /* (DISABLE_WDOG) */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Won't this address the timer and make it so that I can not use it?&amp;nbsp; I only ask because when I do set DISABLE_WDOG to 1 and go to init the COP I get a non functional COP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The configuration from get default config looks correct:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/104177i091366C336CD8C19/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the Init does not change the register values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/104244iC04F72707F4CCE86/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will keep digging into it, but I am a bit lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2020 16:02:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024312#M56335</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2020-04-02T16:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write to COP</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024313#M56336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="307381" data-username="umlengineer" href="https://community.nxp.com/people/umlengineer"&gt;Evan Griffith&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree with you, DISABLE_WDOG must be zero in order to get a functional cop. To do this please disable it from the Preprocessor macros at: properties- &amp;gt; C/C++ Build -&amp;gt; Settings -&amp;gt; MCU C Compiler -&amp;gt; Preprocessor&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/94030iBDEC6BB6972AE88F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check that the macro FSL_FEATURE_COP_HAS_LONGTIME_MODE is defined with one if this macro is not defined to 1 the value loaded to the COP registers may vary from your desired values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2020 18:46:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024313#M56336</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2020-04-06T18:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write to COP</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024314#M56337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not see that line for the watchdog in the settings so I wrote it in, but it solved all of my issues.&amp;nbsp; I guess commenting out the line in code is not the same :smileyhappy:.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2020 16:44:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Unable-to-write-to-COP/m-p/1024314#M56337</guid>
      <dc:creator>umlengineer</dc:creator>
      <dc:date>2020-04-08T16:44:20Z</dc:date>
    </item>
  </channel>
</rss>

