<?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>topic KL27Z FLASH_Erase() causing reset in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634801#M38274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H3 id="toc-hId-1565481665"&gt;Short form:&lt;/H3&gt;&lt;P&gt;When I run my code, I'm getting system resets somewhere inside:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;flash_command_sequence.6917() at fsl_flash.c:2,554 0x4388 
FLASH_Erase() at fsl_flash.c:731 0x4880 &lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;H3 id="toc-hId--986675296"&gt;&lt;/H3&gt;&lt;H3 id="toc-hId-756135039"&gt;Details:&lt;/H3&gt;&lt;P&gt;I'm running code which is closely modeled after the Flash programming example in:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;boards/frdmkl27z/driver_examples/flash/pflash/pflash.c&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, when I call FLASH_Erase(), the system resets. &amp;nbsp;(And since my call to FLASH_Erase() is in the initialization code, it resets repeatedly.) &amp;nbsp;Unfortunately, when I single step into FLASH_Erase(), the call to FLASH_Erase() completes normally which makes it difficult to pinpoint the problem. &amp;nbsp;[UPDATE: at least I thought it did. &amp;nbsp;Now it seems to reset repeatedly when I try to step into callFlashRunCommand(), aka flash_command_sequence.]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system is powered off USB and a SEGGER JLink, so I think it has sufficient power.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice the call flash_command_sequence() has comments about executing position-independent code in memory -- is it possible that the code isn't properly loaded into memory?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what might be causing this, and what I can do to work around it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Mar 2017 11:34:30 GMT</pubDate>
    <dc:creator>robertpoor</dc:creator>
    <dc:date>2017-03-08T11:34:30Z</dc:date>
    <item>
      <title>KL27Z FLASH_Erase() causing reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634801#M38274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H3 id="toc-hId-1565481665"&gt;Short form:&lt;/H3&gt;&lt;P&gt;When I run my code, I'm getting system resets somewhere inside:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;flash_command_sequence.6917() at fsl_flash.c:2,554 0x4388 
FLASH_Erase() at fsl_flash.c:731 0x4880 &lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;H3 id="toc-hId--986675296"&gt;&lt;/H3&gt;&lt;H3 id="toc-hId-756135039"&gt;Details:&lt;/H3&gt;&lt;P&gt;I'm running code which is closely modeled after the Flash programming example in:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;boards/frdmkl27z/driver_examples/flash/pflash/pflash.c&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;However, when I call FLASH_Erase(), the system resets. &amp;nbsp;(And since my call to FLASH_Erase() is in the initialization code, it resets repeatedly.) &amp;nbsp;Unfortunately, when I single step into FLASH_Erase(), the call to FLASH_Erase() completes normally which makes it difficult to pinpoint the problem. &amp;nbsp;[UPDATE: at least I thought it did. &amp;nbsp;Now it seems to reset repeatedly when I try to step into callFlashRunCommand(), aka flash_command_sequence.]&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system is powered off USB and a SEGGER JLink, so I think it has sufficient power.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice the call flash_command_sequence() has comments about executing position-independent code in memory -- is it possible that the code isn't properly loaded into memory?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what might be causing this, and what I can do to work around it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 11:34:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634801#M38274</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-03-08T11:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: KL27Z FLASH_Erase() causing reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634802#M38275</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;Make sure that you run the code from SRAM and with interrupts disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Professional support for Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Findex.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Remote desktop one-on-one coaching: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fservices.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting started to expert videos: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fresults%3Fsearch_query%3Dutasker%2Bshorts" rel="nofollow" target="_blank"&gt;https://www.youtube.com/results?search_query=utasker+shorts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 20:02:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634802#M38275</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-03-08T20:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: KL27Z FLASH_Erase() causing reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634803#M38276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I independently discovered that interrupts were indeed the problem: I had implemented a regular timer interrupt. &amp;nbsp;Turning that off during the time I was writing to flash fixed the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 18:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL27Z-FLASH-Erase-causing-reset/m-p/634803#M38276</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-03-15T18:14:14Z</dc:date>
    </item>
  </channel>
</rss>

