<?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 ERR_VALUE writing using IntFlash on MK22FN512 in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413194#M3119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the Processor Expert IntFlash component to use a part of the program memory of the MK22FN512 as non-volatile storage.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever I call any of the SetByteFlash, SetBlockFlash etc. I get the return value 3 (ERR_VALUE). Stepping through the code sees that this is caused by an Access error.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that the Flash memory on the MK22F512 is in 2KB blocks, so I allocated a ROM/RAM Area in the CPU Component's Build Options at 0x7FC00, with size 0x400 and qualifier RWX. I also reduced the size of the m_text area by 0x400 from 0x7FBF0 to 0x7FBC0. I pass the address 0x7FC00 as the dest in the call to SetByteFlash or SetBlockFlash.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The corresponding calls to GetByteFlash and GetBlockFlash return with no error (ERR_OK) and it appears that the data read out is valid (all 0xFF as I can't write anything there).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any assistance.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jamie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Aug 2015 10:37:21 GMT</pubDate>
    <dc:creator>hypernerd</dc:creator>
    <dc:date>2015-08-05T10:37:21Z</dc:date>
    <item>
      <title>ERR_VALUE writing using IntFlash on MK22FN512</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413194#M3119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the Processor Expert IntFlash component to use a part of the program memory of the MK22FN512 as non-volatile storage.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever I call any of the SetByteFlash, SetBlockFlash etc. I get the return value 3 (ERR_VALUE). Stepping through the code sees that this is caused by an Access error.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that the Flash memory on the MK22F512 is in 2KB blocks, so I allocated a ROM/RAM Area in the CPU Component's Build Options at 0x7FC00, with size 0x400 and qualifier RWX. I also reduced the size of the m_text area by 0x400 from 0x7FBF0 to 0x7FBC0. I pass the address 0x7FC00 as the dest in the call to SetByteFlash or SetBlockFlash.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The corresponding calls to GetByteFlash and GetBlockFlash return with no error (ERR_OK) and it appears that the data read out is valid (all 0xFF as I can't write anything there).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any assistance.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jamie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:37:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413194#M3119</guid>
      <dc:creator>hypernerd</dc:creator>
      <dc:date>2015-08-05T10:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERR_VALUE writing using IntFlash on MK22FN512</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413195#M3120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a similar issue when I was using MK22F512 but I was using SSD flash driver with KSDK1.2.0. I found that the problem was that the microcontroller was running in high speed run mode by default (HSRUN) and after some research, I figured out that I cannot write to flash in that mode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the following link to learn more about HSRUN mode:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4985.pdf" title="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4985.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4985.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I changed the clock to run in normal run mode, I was able to write to flash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 21:41:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413195#M3120</guid>
      <dc:creator>priya_dwivedula</dc:creator>
      <dc:date>2015-08-05T21:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: ERR_VALUE writing using IntFlash on MK22FN512</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413196#M3121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jamie,&lt;/P&gt;&lt;P&gt;The issue can be also caused by protection settings of your flash memory. You can find these settings in the &lt;EM&gt;Component Inspector &lt;/EM&gt;of the CPU component, &lt;EM&gt;Common Settings / Flash configuration field / Protection regions&lt;/EM&gt; property group. See also the following screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/55482i19AB1F921A164087/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 12:18:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413196#M3121</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-08-06T12:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: ERR_VALUE writing using IntFlash on MK22FN512</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413197#M3122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this solved it. I had the Core clock at 120MHz, which forces HSRUN mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a second clock configuration with the Core clock at 80MHz (the limit before HSRUN is forced) and switch to that just before writing to Flash. I also had to set the IntFlash to be enabled in Low Speed mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 08:24:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/ERR-VALUE-writing-using-IntFlash-on-MK22FN512/m-p/413197#M3122</guid>
      <dc:creator>hypernerd</dc:creator>
      <dc:date>2015-08-07T08:24:56Z</dc:date>
    </item>
  </channel>
</rss>

