<?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: Kinetis  flash operation in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1411621#M4495</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your feedback.&lt;/P&gt;&lt;P&gt;Now I know kinetis flash can not read and programmed/erased a same flash bank at the same time.&lt;/P&gt;&lt;P&gt;If I want to do this, it have to copy run command to ram or enable ESFC bit in MCM PLACR.&lt;/P&gt;&lt;P&gt;But I found the SDK as below. when FTFx_DRIVER_IS_FLASH_RESIDENT is open, it will copy run command to ram. but why do not add disable interrupt and enable interrupt before and after&amp;nbsp; running flash ram command. Also do not&amp;nbsp;Enable stalling flash controller when flash is busy when FTFx_DRIVER_IS_FLASH_RESIDENT is not open.&lt;/P&gt;&lt;P&gt;if do not do this, it will lead something wrong, such as: chip reset(flash operation hard fault), print out messy logs, when&amp;nbsp;read and programmed/erased a same flash bank at the same time.&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;* @brief FTFx Command Sequence&lt;BR /&gt;*&lt;BR /&gt;* This function is used to perform the command write sequence to the flash.&lt;BR /&gt;*&lt;BR /&gt;* @param driver Pointer to storage for the driver runtime state.&lt;BR /&gt;* @return An error code or kStatus_FTFx_Success&lt;BR /&gt;*/&lt;BR /&gt;static status_t ftfx_command_sequence(ftfx_config_t *config)&lt;BR /&gt;{&lt;BR /&gt;uint8_t registerValue;&lt;/P&gt;&lt;P&gt;#if FTFx_DRIVER_IS_FLASH_RESIDENT&lt;BR /&gt;&lt;BR /&gt;/* clear RDCOLERR &amp;amp; ACCERR &amp;amp; FPVIOL flag in flash status register */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK;&lt;/P&gt;&lt;P&gt;/* Since the value of ARM function pointer is always odd, but the real start address&lt;BR /&gt;* of function memory should be even, that's why +1 operation exist. */&lt;BR /&gt;config-&amp;gt;runCmdFuncAddr.commadAddr += 1UL;&lt;BR /&gt;callFtfxRunCommand_t callFtfxRunCommand = config-&amp;gt;runCmdFuncAddr.callFlashCommand;&lt;/P&gt;&lt;P&gt;/* We pass the ftfx_fstat address as a parameter to flash_run_comamnd() instead of using&lt;BR /&gt;* pre-processed MICRO sentences or operating global variable in flash_run_comamnd()&lt;BR /&gt;* to make sure that flash_run_command() will be compiled into position-independent code (PIC). */&lt;BR /&gt;callFtfxRunCommand((FTFx_REG8_ACCESS_TYPE)(&amp;amp;FTFx-&amp;gt;FSTAT));&lt;BR /&gt;config-&amp;gt;runCmdFuncAddr.commadAddr -= 1UL;&lt;BR /&gt;&lt;BR /&gt;#else&lt;BR /&gt;/* clear RDCOLERR &amp;amp; ACCERR &amp;amp; FPVIOL flag in flash status register */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK;&lt;BR /&gt;&lt;BR /&gt;/* clear CCIF bit */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_CCIF_MASK;&lt;/P&gt;&lt;P&gt;/* Check CCIF bit of the flash status register, wait till it is set.&lt;BR /&gt;* IP team indicates that this loop will always complete. */&lt;BR /&gt;while (!(FTFx-&amp;gt;FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 07:32:33 GMT</pubDate>
    <dc:creator>rodger_an</dc:creator>
    <dc:date>2022-02-10T07:32:33Z</dc:date>
    <item>
      <title>Kinetis  flash operation</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1406398#M4488</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;From "K32 L2B Sub-Family Reference Manual",&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rodger_an_2-1643345656752.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/169096i410054204361BFA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rodger_an_2-1643345656752.png" alt="rodger_an_2-1643345656752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rodger_an_1-1643345555612.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/169094iA300FA5C3002F94A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rodger_an_1-1643345555612.png" alt="rodger_an_1-1643345555612.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rodger_an_0-1643345533944.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/169093iBD96B3D8D0EAA765/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rodger_an_0-1643345533944.png" alt="rodger_an_0-1643345533944.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What does it mean for the above table?&lt;/P&gt;&lt;P&gt;My application,&lt;/P&gt;&lt;P&gt;Such as: application SW is about 100k, the flash is 128k, flash 0 and flash 1 is equal(64k). Now I want to use the last page of flash 1 as eeprom emulator. Does this design work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rodger_an_3-1643345980183.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/169100i92C47F441A1A70C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rodger_an_3-1643345980183.png" alt="rodger_an_3-1643345980183.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What does it mean?&lt;/P&gt;&lt;P&gt;Can the flash be programmed and read for 8 bits, 16 bits and 32 bits? All these bits are supported?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 05:01:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1406398#M4488</guid>
      <dc:creator>rodger_an</dc:creator>
      <dc:date>2022-01-28T05:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis  flash operation</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1406450#M4489</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A&amp;nbsp;&lt;/SPAN&gt;&lt;A title="Popularization of Science - MCU" href="https://www.apogeeweb.net/electron/popularization-of-science-mcu.html" target="_self"&gt;&lt;STRONG&gt;microcontroller&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;STRONG&gt;MCU&lt;/STRONG&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;A title="Popularization of Science - MCU" href="https://www.apogeeweb.net/electron/popularization-of-science-mcu.html" target="_self"&gt;)&lt;/A&gt; is a small computer built on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip. A microcontroller is made up of a&amp;nbsp;CPU&amp;nbsp; (processor core), memory, and programmable input/output peripherals. On chip, a small amount of&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://en.wikipedia.org/wiki/Random-access_memory" rel="nofollow" target="_blank"&gt;&lt;U&gt;RAM&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;, as well as ferroelectric RAM, NOR flash, or&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://en.wikipedia.org/wiki/One-time_password" rel="nofollow" target="_blank"&gt;&lt;U&gt;OTP&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;ROM , is commonly included. Microcontrollers&amp;nbsp; , in contrast to microprocessors&amp;nbsp; used in personal computers&amp;nbsp; or other general-purpose applications, are designed for embedded applications and are made up of a number of discrete chips. This article will delve deeper into the MCU.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 07:07:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1406450#M4489</guid>
      <dc:creator>xiaoye</dc:creator>
      <dc:date>2022-01-28T07:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis  flash operation</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1411432#M4494</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194450"&gt;@rodger_an&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to apologize for the delay. We are experiencing high volume of questions these days. I really appreciate your patience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your question, that table means that you can do two operations at the same time to the 2 different flash memories that mcu has, for example you can read Flash 1 while you are programming Flash 0.&lt;BR /&gt;In order to use a flash as EEPROM, which design you are referring to? I can suggest you to read this thread of our community to use flash emulating an EEPROM:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/Ways-of-Storing-data-in-non-volatile-memory/td-p/481025" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/Ways-of-Storing-data-in-non-volatile-memory/td-p/481025.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And for your last question, you can only read from flash 8-bit, 16-bit or 32-bit too, but not program those words size,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope the information is helpful, please let me know if you have more questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards.&lt;BR /&gt;Pablo Avalos.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 01:37:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1411432#M4494</guid>
      <dc:creator>PabloAvalos</dc:creator>
      <dc:date>2022-02-10T01:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis  flash operation</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1411621#M4495</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your feedback.&lt;/P&gt;&lt;P&gt;Now I know kinetis flash can not read and programmed/erased a same flash bank at the same time.&lt;/P&gt;&lt;P&gt;If I want to do this, it have to copy run command to ram or enable ESFC bit in MCM PLACR.&lt;/P&gt;&lt;P&gt;But I found the SDK as below. when FTFx_DRIVER_IS_FLASH_RESIDENT is open, it will copy run command to ram. but why do not add disable interrupt and enable interrupt before and after&amp;nbsp; running flash ram command. Also do not&amp;nbsp;Enable stalling flash controller when flash is busy when FTFx_DRIVER_IS_FLASH_RESIDENT is not open.&lt;/P&gt;&lt;P&gt;if do not do this, it will lead something wrong, such as: chip reset(flash operation hard fault), print out messy logs, when&amp;nbsp;read and programmed/erased a same flash bank at the same time.&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;* @brief FTFx Command Sequence&lt;BR /&gt;*&lt;BR /&gt;* This function is used to perform the command write sequence to the flash.&lt;BR /&gt;*&lt;BR /&gt;* @param driver Pointer to storage for the driver runtime state.&lt;BR /&gt;* @return An error code or kStatus_FTFx_Success&lt;BR /&gt;*/&lt;BR /&gt;static status_t ftfx_command_sequence(ftfx_config_t *config)&lt;BR /&gt;{&lt;BR /&gt;uint8_t registerValue;&lt;/P&gt;&lt;P&gt;#if FTFx_DRIVER_IS_FLASH_RESIDENT&lt;BR /&gt;&lt;BR /&gt;/* clear RDCOLERR &amp;amp; ACCERR &amp;amp; FPVIOL flag in flash status register */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK;&lt;/P&gt;&lt;P&gt;/* Since the value of ARM function pointer is always odd, but the real start address&lt;BR /&gt;* of function memory should be even, that's why +1 operation exist. */&lt;BR /&gt;config-&amp;gt;runCmdFuncAddr.commadAddr += 1UL;&lt;BR /&gt;callFtfxRunCommand_t callFtfxRunCommand = config-&amp;gt;runCmdFuncAddr.callFlashCommand;&lt;/P&gt;&lt;P&gt;/* We pass the ftfx_fstat address as a parameter to flash_run_comamnd() instead of using&lt;BR /&gt;* pre-processed MICRO sentences or operating global variable in flash_run_comamnd()&lt;BR /&gt;* to make sure that flash_run_command() will be compiled into position-independent code (PIC). */&lt;BR /&gt;callFtfxRunCommand((FTFx_REG8_ACCESS_TYPE)(&amp;amp;FTFx-&amp;gt;FSTAT));&lt;BR /&gt;config-&amp;gt;runCmdFuncAddr.commadAddr -= 1UL;&lt;BR /&gt;&lt;BR /&gt;#else&lt;BR /&gt;/* clear RDCOLERR &amp;amp; ACCERR &amp;amp; FPVIOL flag in flash status register */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_RDCOLERR_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_FPVIOL_MASK;&lt;BR /&gt;&lt;BR /&gt;/* clear CCIF bit */&lt;BR /&gt;FTFx-&amp;gt;FSTAT = FTFx_FSTAT_CCIF_MASK;&lt;/P&gt;&lt;P&gt;/* Check CCIF bit of the flash status register, wait till it is set.&lt;BR /&gt;* IP team indicates that this loop will always complete. */&lt;BR /&gt;while (!(FTFx-&amp;gt;FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;#endif /* FTFx_DRIVER_IS_FLASH_RESIDENT */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 07:32:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1411621#M4495</guid>
      <dc:creator>rodger_an</dc:creator>
      <dc:date>2022-02-10T07:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis  flash operation</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1418236#M4511</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194450"&gt;@rodger_an&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please accept my apologies for the delay, we are still overloaded on Kinetis request in our community. I really appreciate your patience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your situation, I found a thread in our community marked as solution than can helps massively. You can find it clicking it here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-Erase-Flash-memory/td-p/823391" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-Erase-Flash-memory/td-p/823391&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In addition, it mentions an Application Note, the AN4695, where you may take a look to find what you are looking for. I will attach this one to the post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you have more concerns, so I can help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks you so much.&lt;BR /&gt;Best Regards.&lt;BR /&gt;Pablo Avalos.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 12:33:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Kinetis-flash-operation/m-p/1418236#M4511</guid>
      <dc:creator>PabloAvalos</dc:creator>
      <dc:date>2022-02-23T12:33:22Z</dc:date>
    </item>
  </channel>
</rss>

