<?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 Problems using internal flash in MK22F in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-using-internal-flash-in-MK22F/m-p/642000#M6904</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 do not get the "pflash_frdmk22f" example code from SDK 2.1 to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code fails in main() after calling (line 180) :&lt;/P&gt;&lt;P&gt;result = FLASH_Erase(&amp;amp;s_flashDriver, destAdrss, pflashSectorSize, kFLASH_ApiEraseKey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result is set to 103 meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Command is not available under current mode/security."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I cant understand why. The flash is not in secure mode and no flash blocks are protected. I am running on my own HW and had to modify the "BOARD_BootClockRUN()" &amp;nbsp;function to clock the MCU from internal instead of external clock source, other than that the code example is unchanged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions to what can be wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 10:43:48 GMT</pubDate>
    <dc:creator>olavbirkeland</dc:creator>
    <dc:date>2017-04-25T10:43:48Z</dc:date>
    <item>
      <title>Problems using internal flash in MK22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-using-internal-flash-in-MK22F/m-p/642000#M6904</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 do not get the "pflash_frdmk22f" example code from SDK 2.1 to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code fails in main() after calling (line 180) :&lt;/P&gt;&lt;P&gt;result = FLASH_Erase(&amp;amp;s_flashDriver, destAdrss, pflashSectorSize, kFLASH_ApiEraseKey);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result is set to 103 meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Command is not available under current mode/security."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I cant understand why. The flash is not in secure mode and no flash blocks are protected. I am running on my own HW and had to modify the "BOARD_BootClockRUN()" &amp;nbsp;function to clock the MCU from internal instead of external clock source, other than that the code example is unchanged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions to what can be wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:43:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-using-internal-flash-in-MK22F/m-p/642000#M6904</guid>
      <dc:creator>olavbirkeland</dc:creator>
      <dc:date>2017-04-25T10:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using internal flash in MK22F</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-using-internal-flash-in-MK22F/m-p/642001#M6905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I finally found the reason to the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the reference manual for K22F chapter 3.5.1.5 "Flash Program Restrictions" it is stated that the flash should not be programmed while operating in High Speed Run or VLPR power modes. As I explained in my question I changed the clock driving source (and run mode) and was running in High Speed Run mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything worked after changing to RUN mode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 12:02:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Problems-using-internal-flash-in-MK22F/m-p/642001#M6905</guid>
      <dc:creator>olavbirkeland</dc:creator>
      <dc:date>2017-04-27T12:02:46Z</dc:date>
    </item>
  </channel>
</rss>

