<?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>MQX Software SolutionsのトピックRe: MFS with internal flash on M52255</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183379#M2990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the flashx demo application (with MQX 3.8) I guess you need to unprotect the flash (by calling&amp;nbsp;ioctl(flash_file, FLASH_IOCTL_WRITE_PROTECT, &amp;amp;ioctl_param)&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; to be able to write to the internal flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jun 2012 14:30:41 GMT</pubDate>
    <dc:creator>NeraPhil</dc:creator>
    <dc:date>2012-06-26T14:30:41Z</dc:date>
    <item>
      <title>MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183374#M2985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As title, how can I read/write internal flash of M52259 with MFS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I installed flashx driver, opened device and installed MFS, but I cannot format the device.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* initialize internel flash device */pf_IntFlash=fopen("flashx:", NULL);if(pf_IntFlash==NULL)printf("Error open internal flash device!\n");else{ /* mount filesystem */ mfsStatus=_io_mfs_install(pf_IntFlash, "c:", (_file_size)0);    if(mfsStatus != MFS_NO_ERROR)printf("MFS install failed!\n"); else {  /* format if needed */  FILE_PTR pf_fd;  int_32 error_code;  /* Open the filesystem and detect, if format is required */  pf_fd = fopen("c:", NULL);  error_code = ferror(pf_fd);  if(error_code==MFS_NO_ERROR)printf("Internal flash device initialized.\n");  else if (error_code == MFS_NOT_A_DOS_DISK)   {   /* no file system, need to format */   printf("Formating internal flash drive...\n");   error_code=ioctl(pf_fd, IO_IOCTL_DEFAULT_FORMAT, NULL);   if(error_code)printf("IntFlash format error!(%X)\n", error_code);  }  else printf("Error while opening c:\\ (%s)\n", MFS_Error_text((uint_32)(uint_32)error_code));  //fclose(pf_fd); }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The result like following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Formating internal flash drive...IntFlash format error!(301D)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The error code means&amp;nbsp;MFS_WRITE_FAULT, but I don't know how to solve this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Max.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:34:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183374#M2985</guid>
      <dc:creator>ck_max</dc:creator>
      <dc:date>2020-10-29T09:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183375#M2986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand why you would format internal flash if you have code running in flash, that will erase all your code and finally you get exception, if you really need to do this, you at least have to move code to sram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 13:20:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183375#M2986</guid>
      <dc:creator>cutworth</dc:creator>
      <dc:date>2010-04-14T13:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183376#M2987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar situation where I want to use internal Flash to store web pages.&lt;/P&gt;&lt;P&gt;The 52259 has 512K which is considerable, and I'd like to use the last 64K or 128K to upload webpages. &amp;nbsp;As it is now, I have to rebuild the entire image.&lt;/P&gt;&lt;P&gt;Ideally, I'd like to upload webpages using ftp or tfpt or a shell command.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 02:45:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183376#M2987</guid>
      <dc:creator>bonzo</dc:creator>
      <dc:date>2010-12-21T02:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183377#M2988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bonzo-- did you ever figure out a solution for this MFS on internal Flash? I'm trying to do the same thing now and getting a write protect error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Mar 2012 05:13:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183377#M2988</guid>
      <dc:creator>Jeinstei</dc:creator>
      <dc:date>2012-03-10T05:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183378#M2989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the same problem.&lt;/P&gt;&lt;P&gt;I want to write some files in the internal Flash using the MFS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;/*************************************************/&lt;/P&gt;&lt;P&gt;flash_handle = fopen("flashx:bank1", NULL);&lt;BR /&gt;if (flash_handle == NULL)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;param = IO_O_RDWR; // Read and Write FLASH, just in case&lt;BR /&gt;if (IO_OK != ioctl(flash_handle, IO_IOCTL_SET_FLAGS, (char_ptr) &amp;amp;param))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;// FILE SYSTEM installation over&amp;nbsp; FLASH&lt;BR /&gt;error_code = _io_mfs_install(flash_handle, filesystem_name, (_file_size)0);&lt;BR /&gt;if (error_code != MFS_NO_ERROR)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&amp;nbsp;&amp;nbsp; &amp;nbsp;&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;&lt;BR /&gt;//Open FILE SYSTEM&lt;BR /&gt;filesystem_handle = fopen(filesystem_name, NULL);&lt;BR /&gt;error_code = ferror (filesystem_handle);&lt;BR /&gt;if ((error_code != MFS_NO_ERROR) &amp;amp;&amp;amp; (error_code != MFS_NOT_A_DOS_DISK))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&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; &amp;nbsp;&lt;BR /&gt;// if not Formated, I do Format&lt;BR /&gt;if (error_code == MFS_NOT_A_DOS_DISK)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ioctl(filesystem_handle, IO_IOCTL_DEFAULT_FORMAT, NULL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;ioctl( filesystem_handle, IO_IOCTL_FAT_CACHE_OFF, NULL);&amp;nbsp;&amp;nbsp; &amp;nbsp;// without CACHE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;// Open and close a file, if it do not exist, it is created&lt;BR /&gt;file_0 = NULL;&lt;BR /&gt;file_0 = fopen(FullFileName, "a");&lt;BR /&gt;fclose(file_0);&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;ioctl( filesystem_handle, IO_IOCTL_FLUSH_FAT, NULL); // flush file system&lt;/P&gt;&lt;P&gt;// Open the file&lt;BR /&gt;file_0 = fopen(FullFileName, "r+");&lt;BR /&gt;if (file_0 == NULL)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;BR /&gt;memset(buffer, 0, sizeof buffer);&lt;/P&gt;&lt;P&gt;len = read(file_0, buffer, 32);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;if( strcmp( buffer, "HELLO") ) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strcpy(buffer, "HELLO");&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; fseek(file_0, -32, IO_SEEK_END);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; write(file_0, buffer, 32);&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; fflush(file_0);&lt;BR /&gt;}&lt;BR /&gt;fclose(file_0);&lt;BR /&gt;ioctl( filesystem_handle, IO_IOCTL_FLUSH_FAT, NULL); // Fluch file system&lt;/P&gt;&lt;P&gt;/********************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can write the files, but when I try to access again,&amp;nbsp; I cannot find the file. I always have to create it again. I inspect the flash, and&amp;nbsp; I can see the file contents, but the file system do not see it.&lt;/P&gt;&lt;P&gt;I think the problem is that&amp;nbsp; IO_IOCTL_FLUSH_FAT is not working or something like that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 21:36:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183378#M2989</guid>
      <dc:creator>jausel</dc:creator>
      <dc:date>2012-06-20T21:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183379#M2990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the flashx demo application (with MQX 3.8) I guess you need to unprotect the flash (by calling&amp;nbsp;ioctl(flash_file, FLASH_IOCTL_WRITE_PROTECT, &amp;amp;ioctl_param)&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; to be able to write to the internal flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Philipp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2012 14:30:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183379#M2990</guid>
      <dc:creator>NeraPhil</dc:creator>
      <dc:date>2012-06-26T14:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: MFS with internal flash on M52255</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183380#M2991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am experiencing the same problem with MFS on Internal Flash on a K60 chip, using FlashX, Partition Manager, and MFS. I can install, format, check it's formatted, see no errors, appear to write the file, and then upon reading the file nothing is read, and the buffer I have allocated to take the read data is not changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 18:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MFS-with-internal-flash-on-M52255/m-p/183380#M2991</guid>
      <dc:creator>ironsean</dc:creator>
      <dc:date>2014-04-02T18:46:45Z</dc:date>
    </item>
  </channel>
</rss>

