<?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: Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655797#M40028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;Now I'm try to execute code from ram. I will return my result probably tomorrow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Feb 2017 17:41:05 GMT</pubDate>
    <dc:creator>alessiodemarchi</dc:creator>
    <dc:date>2017-02-21T17:41:05Z</dc:date>
    <item>
      <title>Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655794#M40025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm try to use the last sector of flash (S9KEAZN8 micro) as a simple eeprom (I have to save some trimming value for my application). I use IAR WorkBench as development tool.&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;void waitForCommandExecute()&lt;BR /&gt;{&lt;BR /&gt;unsigned char statVal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; statVal = FTMRE_FSTAT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; statVal &amp;amp;= FTMRE_FSTAT_CCIF_MASK;&lt;BR /&gt;&amp;nbsp; } while (statVal == 0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;/* The next row is where the program stop working */&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ((FTMRE_FCLKDIV &amp;amp; FTMRE_FCLKDIV_FDIVLD_MASK) != FTMRE_FCLKDIV_FDIVLD_MASK)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; waitForCommandExecute();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCLKDIV = ((configBUS_CLOCK_HZ / 1000 + 399U) / 1000U - 1U);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCLKDIV |= FTMRE_FCLKDIV_FDIVLCK_MASK;&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ((FTMRE_FSTAT &amp;amp; FTMRE_FSTAT_ACCERR_MASK) != 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FSTAT |= FTMRE_FSTAT_ACCERR_MASK;&lt;BR /&gt;&amp;nbsp; if ((FTMRE_FSTAT &amp;amp; FTMRE_FSTAT_FPVIOL_MASK) != 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FSTAT |= FTMRE_FSTAT_FPVIOL_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // EEPROM/Flash erase&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBIX = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBHI = 0x0a; // sector Erase&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBLO = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBIX = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBHI = (u8_t)(BASE_FLASH_EEPROMADDRESS &amp;gt;&amp;gt; 8);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FCCOBLO = (u8_t)(BASE_FLASH_EEPROMADDRESS &amp;amp; 0xff);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FSTAT |= FTMRE_FSTAT_CCIF_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; waitForCommandExecute();&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;But when I execute the code step by step the Ide freeze with a message program of flash ...&lt;/P&gt;&lt;P&gt;I don't know what happens. Can anyone help me?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:37:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655794#M40025</guid>
      <dc:creator>alessiodemarchi</dc:creator>
      <dc:date>2017-02-21T15:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655795#M40026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code should act as flash sector erase, but the problem is the same as for the flash write.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 15:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655795#M40026</guid>
      <dc:creator>alessiodemarchi</dc:creator>
      <dc:date>2017-02-21T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655796#M40027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alessio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTMRE_FSTAT |= FTMRE_FSTAT_CCIF_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; waitForCommandExecute();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;must be executed from SRAM and not from Flash - it will immediately fail if executed in Flash since the Flash becomes unreadable while it is being erased. Also one usually protects the call from interrupts since an interrupt will usually cause Flash to be accessed and so a failure too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To save time, this is available in the uTasker KEA project, which is available as open source at &lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fforum%2Findex.php%3Ftopic%3D1721.msg7086%23msg7086" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=1721.msg7086#msg7086&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its flash driver is compatible with all Flash and EEPROM in KE, KEA, KL, K etc. parts and includes Flash emulation to identify issues before they get to the HW (with fail-safe parameter system in Flash/EEPROM emulation).&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;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>Tue, 21 Feb 2017 16:39:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655796#M40027</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-02-21T16:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655797#M40028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;Now I'm try to execute code from ram. I will return my result probably tomorrow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 17:41:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655797#M40028</guid>
      <dc:creator>alessiodemarchi</dc:creator>
      <dc:date>2017-02-21T17:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Hi: Can anyone tell me where I'm wrong in write internal flash application?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655798#M40029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I try to execute the code from FLASH but with interrupt disabled and the code is running well.&lt;/P&gt;&lt;P&gt;Tomorrow I try a long test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 17:44:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Hi-Can-anyone-tell-me-where-I-m-wrong-in-write-internal-flash/m-p/655798#M40029</guid>
      <dc:creator>alessiodemarchi</dc:creator>
      <dc:date>2017-02-21T17:44:02Z</dc:date>
    </item>
  </channel>
</rss>

