<?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>S32KのトピックRe: c90tfs_flash_driver - unable to erase and program</title>
    <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437534#M14728</link>
    <description>&lt;P&gt;The forum seems to have some bugs, I posted a reply it appeared then after a while it disappeared, have to post it multiple times to get it on.&lt;/P&gt;&lt;P&gt;While on the topic, can you also let me know how to program more than 160 bytes using this flash driver. There is a method called which is disabled from compiling.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;#if FSL_FEATURE_FLS_HAS_PROGRAM_SECTION_CMD&lt;/P&gt;&lt;P&gt;FlashProgramSection&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Fri, 01 Apr 2022 08:34:49 GMT</pubDate>
    <dc:creator>Can_Do_bus</dc:creator>
    <dc:date>2022-04-01T08:34:49Z</dc:date>
    <item>
      <title>c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437273#M14719</link>
      <description>&lt;P&gt;I am using S32k144 - I am using design studio to run the code in debug mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code runs in NVM, I am executing the following commands in my code to erase and then program the P Flash area, i.e erase the same sector and&amp;nbsp; followed&amp;nbsp; by writing to that sector.&lt;/P&gt;&lt;P&gt;The code works if I either erase or program i.e if I run the program once with the FlashProgram command commented, it will erase the sector. When I run it subsequently to execute FlashProgram command with FlashEraseSector &lt;STRONG&gt;commented out&lt;/STRONG&gt; line, this setup works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I try to execute them together as below, it doesn't erase.&amp;nbsp; What is the issue&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FlashEraseSector(&amp;amp;flashSSDConfig, flash_prog_address, FEATURE_FLS_PF_BLOCK_SECTOR_SIZE, FlashCommandSequence);
cycles=10000;
while(cycles--);
unsigned char testdata[] = {0xAA,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC};

FlashProgram(&amp;amp;flashSSDConfig, flash_prog_address, 40, testdata , FlashCommandSequence);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 00:35:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437273#M14719</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-01T00:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437344#M14720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try waiting for &lt;STRONG&gt;FlashEraseSector&lt;/STRONG&gt; to return &lt;STRONG&gt;FTFx_OK&lt;/STRONG&gt;? It seems to be caused by too little waiting time.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table 33 Return Values for FlashEraseSector.png" style="width: 677px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/175565i78962F10AD191347/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table 33 Return Values for FlashEraseSector.png" alt="Table 33 Return Values for FlashEraseSector.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&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;- 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;</description>
      <pubDate>Fri, 01 Apr 2022 03:29:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437344#M14720</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-04-01T03:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437480#M14724</link>
      <description>&lt;P&gt;Can you provide me a suitable code for the call back, currently I am passing NULL CALLBACK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even otherwise the erasefunction doesn't return if both the functions are present (atleast in the debugger I am not able to get the return value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; ret = pFlashCommandSequence(pSSDConfig);  &amp;lt;--- the code crashes here doesn't return

/*! @brief Configuration structure flashCfg_0 */
const flash_user_config_t Flash_InitConfig0 = {
		/* for the S32K144 */

		.PFlashBase  = 0x00000000U,
		.PFlashSize  = 0x00080000U,
		.DFlashBase  = 0x10000000U,
		.EERAMBase   = 0x14000000U,
		.CallBack    = NULL_CALLBACK
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 07:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437480#M14724</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-01T07:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437514#M14726</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;returncode = FlashEraseSector(&amp;amp;flashSSDConfig, flash_prog_address, FEATURE_FLS_PF_BLOCK_SECTOR_SIZE, FlashCommandSequence);
		while (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))
		{

		}
		int cycles = 1720000;
		while(cycles--);


	unsigned char testdata[] = {0xDD,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xAA,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC};



		returncode = FlashProgram(&amp;amp;flashSSDConfig, flash_prog_address,40 , testdata , FlashCommandSequence);
		while (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))
		{

		}
		int cycles = 1720000;
			   while(cycles--);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the above code, the code doesn't crash, i.e both the lines executed however NO ERASE and NO WRITE occurs.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 07:58:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437514#M14726</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-01T07:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437532#M14727</link>
      <description>&lt;P&gt;The following code prevents code crashing, however neither the memory is erased or reprogrammed - one of the flash operation still has to be commented out for the other one to succeed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	//returncode = FlashEraseSector(&amp;amp;flashSSDConfig, flash_prog_address, FEATURE_FLS_PF_BLOCK_SECTOR_SIZE, FlashCommandSequence);
		while (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))
		{

		}
		int cycles = 1720000;
		while(cycles--);


	}
	unsigned char testdata[] = {0xDD,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xAA,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,
			0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xBB,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC};



		returncode = FlashProgram(&amp;amp;flashSSDConfig, flash_prog_address,40 , testdata , FlashCommandSequence);
		while (0U == (FTFx_FSTAT &amp;amp; FTFx_FSTAT_CCIF_MASK))
		{

		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 08:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437532#M14727</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-01T08:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437534#M14728</link>
      <description>&lt;P&gt;The forum seems to have some bugs, I posted a reply it appeared then after a while it disappeared, have to post it multiple times to get it on.&lt;/P&gt;&lt;P&gt;While on the topic, can you also let me know how to program more than 160 bytes using this flash driver. There is a method called which is disabled from compiling.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;#if FSL_FEATURE_FLS_HAS_PROGRAM_SECTION_CMD&lt;/P&gt;&lt;P&gt;FlashProgramSection&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 01 Apr 2022 08:34:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1437534#M14728</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-01T08:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: c90tfs_flash_driver - unable to erase and program</title>
      <link>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1438166#M14748</link>
      <description>&lt;P&gt;The driver seems to have some bugs, it was much easier to write 5 lines of code to write to internal flash rather than trying to debug these drivers.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 06:34:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/c90tfs-flash-driver-unable-to-erase-and-program/m-p/1438166#M14748</guid>
      <dc:creator>Can_Do_bus</dc:creator>
      <dc:date>2022-04-04T06:34:11Z</dc:date>
    </item>
  </channel>
</rss>

