<?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のトピックKM34Z256 flash erase sector problem</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603901#M35530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear support:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I used the function below to erase sector 2K for KM34Z256VLQ7 in TWR-KM34Z75M development board, from the memory watch I can't find the flash is erased sucessfully. Can you provide some information for me?&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;#if defined (__ICCARM__)&lt;BR /&gt;&amp;nbsp; __ramfunc void _FTFA_EraseSector (const void *pDst)&lt;BR /&gt;#elif defined(__GNUC__) || defined(__CC_ARM)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void _FTFA_EraseSector (const void *pDst)&lt;BR /&gt;#endif&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if ((FTFA_FSTAT &amp;amp; FTFA_FSTAT_FPVIOL_MASK) ||&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (FTFA_FSTAT &amp;amp; FTFA_FSTAT_ACCERR_MASK)) { FTFA_FSTAT |= 0x30; }&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB0 = 0x09;&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB1 = (uint8)((uint32)pDst&amp;gt;&amp;gt; 16);&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB2 = (uint8)((uint32)pDst&amp;gt;&amp;gt;&amp;nbsp; 8);&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB3 = (uint8)((uint32)pDst&amp;gt;&amp;gt;&amp;nbsp; 0);&lt;BR /&gt;&amp;nbsp; FTFA_FSTAT |= FTFA_FSTAT_CCIF_MASK;&lt;BR /&gt;&amp;nbsp; while (!(FTFA_FSTAT &amp;amp; FTFA_FSTAT_CCIF_MASK));&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Sep 2016 02:43:53 GMT</pubDate>
    <dc:creator>wulinweng</dc:creator>
    <dc:date>2016-09-09T02:43:53Z</dc:date>
    <item>
      <title>KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603901#M35530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear support:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I used the function below to erase sector 2K for KM34Z256VLQ7 in TWR-KM34Z75M development board, from the memory watch I can't find the flash is erased sucessfully. Can you provide some information for me?&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;#if defined (__ICCARM__)&lt;BR /&gt;&amp;nbsp; __ramfunc void _FTFA_EraseSector (const void *pDst)&lt;BR /&gt;#elif defined(__GNUC__) || defined(__CC_ARM)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void _FTFA_EraseSector (const void *pDst)&lt;BR /&gt;#endif&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; if ((FTFA_FSTAT &amp;amp; FTFA_FSTAT_FPVIOL_MASK) ||&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (FTFA_FSTAT &amp;amp; FTFA_FSTAT_ACCERR_MASK)) { FTFA_FSTAT |= 0x30; }&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB0 = 0x09;&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB1 = (uint8)((uint32)pDst&amp;gt;&amp;gt; 16);&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB2 = (uint8)((uint32)pDst&amp;gt;&amp;gt;&amp;nbsp; 8);&lt;BR /&gt;&amp;nbsp; FTFA_FCCOB3 = (uint8)((uint32)pDst&amp;gt;&amp;gt;&amp;nbsp; 0);&lt;BR /&gt;&amp;nbsp; FTFA_FSTAT |= FTFA_FSTAT_CCIF_MASK;&lt;BR /&gt;&amp;nbsp; while (!(FTFA_FSTAT &amp;amp; FTFA_FSTAT_CCIF_MASK));&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 02:43:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603901#M35530</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-09T02:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603902#M35531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Wulin,&lt;/P&gt;&lt;P&gt;based on the information you provided it is hard to provide any reasonable suggestion on what else to try; the problem could be in the sector definition in linker command file, debugger interaction during erase operation, etc. Therefore, please try our example called &lt;EM&gt;ftfa_test&lt;/EM&gt;&amp;nbsp;from the latest bare-metal drivers for MKM34Z256 device family... You can download drivers from our web&amp;nbsp;&lt;A class="link-titled" href="https://www.nxp.com/webapp/Download?colCode=KMSWDRVAPIRM_SW&amp;amp;location=null&amp;amp;Parent_nodeId=1348518511020721469684&amp;amp;Parent_pageType=product" title="https://www.nxp.com/webapp/Download?colCode=KMSWDRVAPIRM_SW&amp;amp;location=null&amp;amp;Parent_nodeId=1348518511020721469684&amp;amp;Parent_pageType=product"&gt;KMSWDRVAPIRM_SW&lt;/A&gt;. The documentation for example is attached to this reply for your convenience - you can find it also in readme.html that installs together with drivers. The&amp;nbsp;example source code will install in &lt;EM&gt;KM256SWDRV_R4_1_5/src/Projects/ftfa_test&lt;/EM&gt; subfolder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to run this example on your board and if this one fails then we will start looking for potential problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martin M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 07:59:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603902#M35531</guid>
      <dc:creator>MarMi</dc:creator>
      <dc:date>2016-09-09T07:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603903#M35532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Martin,&lt;/P&gt;&lt;P&gt;the demo which you provided me is ok, it means that the hardware board is ok, but in my project is not ok, I have copy that code to the main() function at the first line, it can't erase either. So I don't know when do the flash operation is there any setting before the main() function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 09:02:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603903#M35532</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-09T09:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603904#M35533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Wulin,&lt;/P&gt;&lt;P&gt;I think that issue might be in a linker file because the &lt;EM&gt;ftfa_test &lt;/EM&gt;project uses specific linker file located in the project build subfolder named &lt;EM&gt;MKMxxZ256_flash_FTFA.icf&lt;/EM&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This file, among others, defines symbol (define symbol __CONFIG_FLASH_BLOCK__ = 0x0003f800;) and place .config section at this address (place at address mem:__CONFIG_FLASH_BLOCK__ &amp;nbsp; { readonly &amp;nbsp;section .config };)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this linker procedure is included in your code, I am afraid, I will have to look more deeply into your project to understand better the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martin M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 11:13:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603904#M35533</guid>
      <dc:creator>MarMi</dc:creator>
      <dc:date>2016-09-09T11:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603905#M35534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wulin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please disable the global interrupt before you do the flash operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If it is still not ok, please upload the project, I would like to help you to check it.&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;Jingjing&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, 12 Sep 2016 03:15:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603905#M35534</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-09-12T03:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603906#M35535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;thank you all for so quick reply, unfortunately the problem is still exist.&lt;/P&gt;&lt;P&gt;I have checked the ICF file and disable the interrupt before erase the sector operation, it still not ok.&lt;/P&gt;&lt;P&gt;I will send the project through the email latter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 03:32:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603906#M35535</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-12T03:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603907#M35536</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;Mike-WuLin Weng&lt;/P&gt;&lt;P&gt;ABB Xiamen Low Voltage Equipment Company Limited&lt;/P&gt;&lt;P&gt;No.12-20, 3rd Chuang Xin Road Xiamen SEZ, Fujian 361006 P.R.China&lt;/P&gt;&lt;P&gt;Phone: +86 592 5767829&lt;/P&gt;&lt;P&gt;Mobile: +86 181 5089 0831&lt;/P&gt;&lt;P&gt;email: mike-wulin.weng@cn.abb.com&amp;lt;mailto:mike-wulin.weng@cn.abb.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 03:52:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603907#M35536</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-12T03:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603908#M35537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Wulin,&lt;/P&gt;&lt;P&gt;MKM34Z256 bare-metal drivers and examples disables /NMI interrupt by default in order to eliminate this non-maskable interrupt to occur. However, this is not happening in your project because &lt;SPAN&gt;your project is configured not to program flash configuration field (0x&lt;/SPAN&gt;&lt;SPAN&gt;40&lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt;-0x40&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;) where /NMI interrupt should be disabled by writing FTFL_FOPT[2]=0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to correct your existing project, you need to use attached RCM.board file (with extra parameter: --enable_config_write) and&amp;nbsp;override your existing one - see below.&amp;nbsp;&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/5037i6C13CD9D29AE246B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you're creating new project next time please use &lt;EM&gt;make_project.exe&lt;/EM&gt; utility that is delivered with bare metal drivers. This utility will create new&amp;nbsp;project with all necessary links to drivers including reference to a&amp;nbsp;specific board file. You might also consider using new drivers release for your new developments (release 4.1.5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martin M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 09:15:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603908#M35537</guid>
      <dc:creator>MarMi</dc:creator>
      <dc:date>2016-09-12T09:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603909#M35538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;Thank you for your reply and this is the reason.&lt;/P&gt;&lt;P&gt;I have followed your step and fix the issue, after that I have created new project with release driver 4.1.5 and transfer&lt;/P&gt;&lt;P&gt;my source files to this new project, it seems everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &amp;amp; BR,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 02:20:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603909#M35538</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-14T02:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603910#M35539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;when created the project, the project will used the default project.board, but if I change the IAR .eww file, and open the project, add the IAR .ewp file to the workspace, and it can't use the project.board in the created project foder, what I question is If I want to change the eww file name after created the project used make_project.exe, how can I make sure the project.board will be used in the new name project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 02:50:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603910#M35539</guid>
      <dc:creator>wulinweng</dc:creator>
      <dc:date>2016-09-14T02:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: KM34Z256 flash erase sector problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603911#M35540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Wulin,&lt;/P&gt;&lt;P&gt;Please refer to this thread: &lt;A class="link-titled" href="http://stackoverflow.com/questions/22020845/renaming-in-iar-embedded-work-bench" title="http://stackoverflow.com/questions/22020845/renaming-in-iar-embedded-work-bench"&gt;Renaming in IAR Embedded Work Bench - Stack Overflow&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're opening new project often or see this feature useful, we can update &lt;EM&gt;make_project.exe&lt;/EM&gt; to generate project files named as (project.*) or optionally ("project_name".*) where "project_name" is the information entered by the user during new project creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martin M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 09:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KM34Z256-flash-erase-sector-problem/m-p/603911#M35540</guid>
      <dc:creator>MarMi</dc:creator>
      <dc:date>2016-09-14T09:46:21Z</dc:date>
    </item>
  </channel>
</rss>

