<?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: USB device with MFS ramdisk in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266594#M8057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;If I understand your question fully (Being able to connect tower MCU with USB device MSD enabled so that a file from a PC can be copied to the tower MCU ramdisk.&amp;nbsp; Then copy/move it from SRAM to some other location.&amp;nbsp; Correct?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the TWR-K60D100M with TWR-MEM card that has MRAM.&lt;/P&gt;&lt;P&gt;I modified the msd_disk_twrk60d100m example to also mount the MRAM as MFS.&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_0\usb\device\examples\msd\disk&lt;/P&gt;&lt;P&gt;Actually the application is always opening up the ram disk and checking if it is formatted or not.&amp;nbsp; I just choose to ignore the MQX application and use the PC to load the ram disk with file as shown below.&amp;nbsp; So at this point in time both the MQX application and PC want to format the ram disk.&amp;nbsp; I choose to have the PC app do it for this example (read observations below).&lt;/P&gt;&lt;P&gt;When the application first runs, I plug the TWR USB cable to PC, PC will want to format it, I format it, then copy (drag-n-drop) a file to the TWR ram disk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_04 Feb. 25 11.22.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119114iEAB00395DC1A3879/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_04 Feb. 25 11.22.gif" alt="ScreenHunter_04 Feb. 25 11.22.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_05 Feb. 25 11.22.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119115i17C6631C4B658D04/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_05 Feb. 25 11.22.gif" alt="ScreenHunter_05 Feb. 25 11.22.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_03 Feb. 25 11.21.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119116i4B77C9E11CACE017/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_03 Feb. 25 11.21.gif" alt="ScreenHunter_03 Feb. 25 11.21.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_06 Feb. 25 11.23.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119117iE6EB28788CEA8F5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_06 Feb. 25 11.23.gif" alt="ScreenHunter_06 Feb. 25 11.23.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I now eject the USB disk and disconnect the USB cable from PC and do a POR (power on reset) of the TWR.&lt;/P&gt;&lt;P&gt;The application will then see the ram disk with MFS and see that it has been formatted.&lt;/P&gt;&lt;P&gt;Using the serial concole I can copy/move the file from ram disk to MRAM.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_02 Feb. 25 11.16.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119118i29AD23E9C12A5138/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_02 Feb. 25 11.16.gif" alt="ScreenHunter_02 Feb. 25 11.16.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note the "a:" is the ram disk and "b:" is the MRAM disk.&lt;/P&gt;&lt;P&gt;Please note this is currently a hack and just proves that it can be done.&amp;nbsp; I'm sure others can enhance it to better respond to USB attach/detach events so as not to have to do a POR to refresh the FAT table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observations:&lt;/P&gt;&lt;P&gt;When formatting the ram disk with Win7 64-bit machine, it initially sees the drive as 30KBytes but after the format only 10KBytes is present.&amp;nbsp; I'm guessing extra overhead of Windows formatting???&lt;/P&gt;&lt;P&gt;When I format using the MQX application I get the expected 25KBytes.&amp;nbsp; If Windows looks at this ram disk it does see all 25KBytes.&amp;nbsp; So clearly we have a difference in formatting the FAT32 from MQX to Windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My project source is attached for disk.c and Shell_Task.c (file I added to the project).&amp;nbsp; Also I had to add MFS and Shell&amp;nbsp; libraries to the project "properties" paths for compiler and linker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2013 17:40:00 GMT</pubDate>
    <dc:creator>DavidS</dc:creator>
    <dc:date>2013-02-25T17:40:00Z</dc:date>
    <item>
      <title>USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266589#M8052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to integrate the USB MSD demo with the MFS Ramdisk demo.&amp;nbsp;&amp;nbsp; I thought I had everything working smoothly since I can write a file onto the Ramdisk and see it when I connect the USB to my pc,&amp;nbsp; however when I try to write a file from the USB side of things, I can't seem to find it on the ramdisk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when setting up the ramdisk, I called&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13614295392246397" jivemacro_uid="_13614295392246397"&gt;
&lt;P&gt;mqx_status = _io_mem_install("mfs_writedisk:", (uchar_ptr) g_disk.storage_disk, (_file_size) sizeof(g_disk.storage_disk));&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;using the DISK_STRUCT from the usb device demo, and after setting up the mfs I called&lt;/P&gt;
&lt;P&gt;ioctl(a_fd_ptr, IO_IOCTL_DEFAULT_FORMAT, NULL);&lt;/P&gt;
&lt;P&gt;before setting up the usb device so I wouldn't require the pc to format my device.&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2013 22:13:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266589#M8052</guid>
      <dc:creator>t_k</dc:creator>
      <dc:date>2013-02-20T22:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266590#M8053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that what you want to achieve is this:&lt;/P&gt;&lt;P&gt;C:\Program Files\Freescale\Freescale MQX 3.8\usb\device\examples\msd\disk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Garabo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 17:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266590#M8053</guid>
      <dc:creator>Luis_Garabo</dc:creator>
      <dc:date>2013-02-21T17:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266591#M8054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what I would like to achieve would be to use that demo and be able to read and write files off of it using MQX.&amp;nbsp; I'm assuming to do this that I have to install MFS and have the USB access it.&lt;/P&gt;&lt;P&gt;I wish there was an example similar to C:\Freescale\Freescale_MQX_4_0\mfs\examples\sdcard only using a USB device instead of an sdcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Travis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 17:33:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266591#M8054</guid>
      <dc:creator>t_k</dc:creator>
      <dc:date>2013-02-21T17:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266592#M8055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;Please look at following thread that Garbo and I responded to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/304387"&gt;move or copy a file between multiple MFS (over SD and USB)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also there is MFS USB example:&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_0\mfs\examples\mfs_usb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 17:44:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266592#M8055</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2013-02-21T17:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266593#M8056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I believe the problem I'm having is that I'm trying to use a USB Device, and all the examples seem to be using a USB Host.&lt;/P&gt;&lt;P&gt;Using the demo Garabo mentioned,&amp;nbsp; once the usb device is attached, enumerated, and had a file written to it via PC, how do I read the file off using MQX?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Travis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 18:27:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266593#M8056</guid>
      <dc:creator>t_k</dc:creator>
      <dc:date>2013-02-21T18:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266594#M8057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;If I understand your question fully (Being able to connect tower MCU with USB device MSD enabled so that a file from a PC can be copied to the tower MCU ramdisk.&amp;nbsp; Then copy/move it from SRAM to some other location.&amp;nbsp; Correct?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the TWR-K60D100M with TWR-MEM card that has MRAM.&lt;/P&gt;&lt;P&gt;I modified the msd_disk_twrk60d100m example to also mount the MRAM as MFS.&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_0\usb\device\examples\msd\disk&lt;/P&gt;&lt;P&gt;Actually the application is always opening up the ram disk and checking if it is formatted or not.&amp;nbsp; I just choose to ignore the MQX application and use the PC to load the ram disk with file as shown below.&amp;nbsp; So at this point in time both the MQX application and PC want to format the ram disk.&amp;nbsp; I choose to have the PC app do it for this example (read observations below).&lt;/P&gt;&lt;P&gt;When the application first runs, I plug the TWR USB cable to PC, PC will want to format it, I format it, then copy (drag-n-drop) a file to the TWR ram disk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_04 Feb. 25 11.22.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119114iEAB00395DC1A3879/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_04 Feb. 25 11.22.gif" alt="ScreenHunter_04 Feb. 25 11.22.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_05 Feb. 25 11.22.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119115i17C6631C4B658D04/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_05 Feb. 25 11.22.gif" alt="ScreenHunter_05 Feb. 25 11.22.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_03 Feb. 25 11.21.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119116i4B77C9E11CACE017/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_03 Feb. 25 11.21.gif" alt="ScreenHunter_03 Feb. 25 11.21.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_06 Feb. 25 11.23.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119117iE6EB28788CEA8F5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_06 Feb. 25 11.23.gif" alt="ScreenHunter_06 Feb. 25 11.23.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I now eject the USB disk and disconnect the USB cable from PC and do a POR (power on reset) of the TWR.&lt;/P&gt;&lt;P&gt;The application will then see the ram disk with MFS and see that it has been formatted.&lt;/P&gt;&lt;P&gt;Using the serial concole I can copy/move the file from ram disk to MRAM.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ScreenHunter_02 Feb. 25 11.16.gif"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119118i29AD23E9C12A5138/image-size/large?v=v2&amp;amp;px=999" role="button" title="ScreenHunter_02 Feb. 25 11.16.gif" alt="ScreenHunter_02 Feb. 25 11.16.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note the "a:" is the ram disk and "b:" is the MRAM disk.&lt;/P&gt;&lt;P&gt;Please note this is currently a hack and just proves that it can be done.&amp;nbsp; I'm sure others can enhance it to better respond to USB attach/detach events so as not to have to do a POR to refresh the FAT table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observations:&lt;/P&gt;&lt;P&gt;When formatting the ram disk with Win7 64-bit machine, it initially sees the drive as 30KBytes but after the format only 10KBytes is present.&amp;nbsp; I'm guessing extra overhead of Windows formatting???&lt;/P&gt;&lt;P&gt;When I format using the MQX application I get the expected 25KBytes.&amp;nbsp; If Windows looks at this ram disk it does see all 25KBytes.&amp;nbsp; So clearly we have a difference in formatting the FAT32 from MQX to Windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My project source is attached for disk.c and Shell_Task.c (file I added to the project).&amp;nbsp; Also I had to add MFS and Shell&amp;nbsp; libraries to the project "properties" paths for compiler and linker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 17:40:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266594#M8057</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2013-02-25T17:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: USB device with MFS ramdisk</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266595#M8058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;most of what you've described I have working, however I never attempted to try a POR to refresh the FAT table.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Hopefully that is the step I've been missing.&amp;nbsp;&amp;nbsp; Ideally, I'd prefer not to have to do a POR as I'm trying to use the USB filesystem to enter configuration data to the device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Travis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 19:54:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-device-with-MFS-ramdisk/m-p/266595#M8058</guid>
      <dc:creator>t_k</dc:creator>
      <dc:date>2013-02-25T19:54:27Z</dc:date>
    </item>
  </channel>
</rss>

