<?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 Re: Confused with flash's erasing and programing in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819793#M49620</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Read the flash is very simple, just read the address, and get the address data is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you still have question about it, please create the new question post for yourself, don't follow other's question post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you still want I to reply you, in your own post, you can add assign to kerry zhou, thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Mar 2019 09:13:44 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2019-03-28T09:13:44Z</dc:date>
    <item>
      <title>Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819785#M49612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using KEAZ128 and S32DS, and below are my main function&lt;span class="lia-inline-image-display-wrapper" image-alt="main.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65658iA8663E843782448F/image-size/large?v=v2&amp;amp;px=999" role="button" title="main.PNG" alt="main.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;linker file&lt;span class="lia-inline-image-display-wrapper" image-alt="memory.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65659iEC7C2A5A3D8C5FA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="memory.PNG" alt="memory.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;section setting&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="section.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65660i925C5262DF5BF033/image-size/large?v=v2&amp;amp;px=999" role="button" title="section.PNG" alt="section.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and data defination.&lt;span class="lia-inline-image-display-wrapper" image-alt="data.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65661iDD32D8ED038E49D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="data.PNG" alt="data.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What my problem is that I can erase and program the sector after 0x4000 when there is no flash_data's defination and .mytext section setting. And once I allocate flash_data in the .mytext section, I can't erase and program the sector after 0x4000 anymore. Please help. Project attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 09:33:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819785#M49612</guid>
      <dc:creator>ayanosun</dc:creator>
      <dc:date>2018-07-17T09:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819786#M49613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yan Sun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How do you test it, do you just debug the code and check the memory data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If yes, it's the IDE's problem, when you use the __attribute__ ((section(".mysection1"))) uint32_t flash_data[128]; The IDE seems protect the memory according address.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Actually, I also use the printf to see the data, I find the flash erase and program all works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please check my test result and the attached code:&lt;/P&gt;&lt;P&gt;1. Erase&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/65706i797907B61F853917/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;You can find the memory still 0 after erase, but the printf data is 0XFF, it's correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Program.&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/65710iCE4BC34954793C23/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;Please use my attached project.&lt;/P&gt;&lt;P&gt;In the optimization, please don't select the data section, do it like the following code:&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/65713i62DF14EFEC86153E/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 08:18:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819786#M49613</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-18T08:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819787#M49614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;我在每个节点前后用数组都出来试了一下，结果如下：&lt;/P&gt;&lt;P&gt;擦除前&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="擦除前.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65734i2A91C2BF57A884F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="擦除前.PNG" alt="擦除前.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;擦除后&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="擦除后.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65735i128A4DFE09856423/image-size/large?v=v2&amp;amp;px=999" role="button" title="擦除后.PNG" alt="擦除后.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;写入后&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="写后.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65736i24D58010A48E64C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="写后.PNG" alt="写后.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;就结果来看好像擦除是可以的，但是写入并没有成功。&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 09:06:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819787#M49614</guid>
      <dc:creator>ayanosun</dc:creator>
      <dc:date>2018-07-18T09:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819788#M49615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;楼主，你测试我给你的代码呢。&lt;/P&gt;&lt;P&gt;然后你用串口接收打印就知道了，我的代码我昨天已经测试过了，其实就是比你多了打印功能，不能光相信IDE的debug信息查看。我个人认为S32DS不够成熟，之前这种功能我在CW, KDS, MCUXpressoIDE上面都没遇到过。&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 03:36:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819788#M49615</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-19T03:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819789#M49616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;这个我再多验证一下。还请教一个问题，就是将函数拷到RAM运行是怎么实现的，还是说就是直接将函数用__attribute__分配到ram中就行了？谢谢&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2018 06:08:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819789#M49616</guid>
      <dc:creator>ayanosun</dc:creator>
      <dc:date>2018-07-20T06:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819790#M49617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;对的，其实和flash的操作一样，就是在ld文件中分配的区域是RAM区域。&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2018 02:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819790#M49617</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-07-23T02:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819791#M49618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry :&lt;/P&gt;&lt;P&gt;I am running this program no problem but I delete it.&lt;BR /&gt;FLASH_EraseSector(VERIFIED_SECTOR*FLASH_SECTOR_SIZE);&lt;/P&gt;&lt;P&gt;Read flash but read 0&lt;/P&gt;&lt;P&gt;My problem is how to read the flash value when the power is turned off after the power is turned off.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 00:48:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819791#M49618</guid>
      <dc:creator>peter308</dc:creator>
      <dc:date>2019-03-28T00:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819792#M49619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;My problem is how to read the flash value when the power is turned &lt;SPAN style="color: #ff0000;"&gt;on&amp;nbsp;&lt;/SPAN&gt;after the power is turned off.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 06:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819792#M49619</guid>
      <dc:creator>peter308</dc:creator>
      <dc:date>2019-03-28T06:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Confused with flash's erasing and programing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819793#M49620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Read the flash is very simple, just read the address, and get the address data is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you still have question about it, please create the new question post for yourself, don't follow other's question post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you still want I to reply you, in your own post, you can add assign to kerry zhou, thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 09:13:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Confused-with-flash-s-erasing-and-programing/m-p/819793#M49620</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2019-03-28T09:13:44Z</dc:date>
    </item>
  </channel>
</rss>

