<?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>MCUXpresso General中的主题 Re: Best Example for USB drive to SD card Writing</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007969#M2995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion, my mistake. I mean the K66 board as the host, and the memory stick works as slave. Then reading from USB memory and write to the SD card.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2020 15:14:21 GMT</pubDate>
    <dc:creator>charles2</dc:creator>
    <dc:date>2020-02-25T15:14:21Z</dc:date>
    <item>
      <title>Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007967#M2993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to make K66 development board as the device, and USB stick, connecting to Micro USB port, as the host. Then writing the files from the USB stick to the SD card. Is there an example for this purpose? If not, which one is the closest example I can modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:40:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007967#M2993</guid>
      <dc:creator>charles2</dc:creator>
      <dc:date>2020-02-24T16:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007968#M2994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Charles,&lt;/P&gt;&lt;P&gt;Hope you are doing well.&lt;/P&gt;&lt;P&gt;Could you please clarify the description of your application. From what I am understanding you would like the USB memory stick to work as a host. However this is not possible, a USB memory is a mass storage device.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if I misunderstood you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 01:06:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007968#M2994</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-02-25T01:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007969#M2995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion, my mistake. I mean the K66 board as the host, and the memory stick works as slave. Then reading from USB memory and write to the SD card.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 15:14:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007969#M2995</guid>
      <dc:creator>charles2</dc:creator>
      <dc:date>2020-02-25T15:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007970#M2996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Charles,&lt;/P&gt;&lt;P&gt;The examples that use host_msd are good options to get you started.&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/98011i05C6A97B378B88B4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For more information on how each works please refer to the read me files located in the SDK folder using the followings paths:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK_2.7.0_FRDM-K66F.zip\boards\frdmk66f\usb_examples\usb_host_msd_command\freertos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDK_2.7.0_FRDM-K66F.zip\boards\frdmk66f\usb_examples\usb_host_msd_fatfs\freertos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have further questions.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 18:39:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007970#M2996</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-02-25T18:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007971#M2997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Saniba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 20:15:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007971#M2997</guid>
      <dc:creator>charles2</dc:creator>
      <dc:date>2020-02-25T20:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007972#M2998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to modify the codes in host_msd_fatfs.c file in order to add SDDISK works together with USBDISK. There is no error when I use f_mount function to add the SDDISK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I tried to&amp;nbsp;create &amp;amp; open&amp;nbsp;a file on the SDDISK, it always return error code. I have tried&amp;nbsp; &lt;STRONG&gt;f_open(&amp;amp;file1, "2:file.bin", FA_WRITE | FA_READ | FA_CREATE_ALWAYS),&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;f_open(&amp;amp;file1, test_file_name1, FA_WRITE | FA_READ | FA_CREATE_ALWAYS) &lt;/STRONG&gt;where test_file_name1 is from&lt;STRONG&gt;&amp;nbsp;sprintf(test_file_name1, "%c:", SDDISK + '0').&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I look at the example in sdcard_fatfs, and tried to use make file function like&amp;nbsp;f_mkfs(....), the result is similar to the f_open, always return an error code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I missing?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2020 20:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007972#M2998</guid>
      <dc:creator>charles2</dc:creator>
      <dc:date>2020-03-02T20:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007973#M2999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its possible that it may have to do with the string that is placed for the path and how it is taken.&lt;/P&gt;&lt;P&gt;Please take a look at the &lt;A _jive_internal="true" href="https://community.nxp.com/message/372139"&gt;following post&lt;/A&gt; and try the different option to see if this is your case as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it does not work please let me know.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2020 04:18:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007973#M2999</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2020-03-05T04:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Best Example for USB drive to SD card Writing</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007974#M3000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sabina,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I have figured out the reason why FATfs is not working. It is because the SD card was not initialized. I found the boolean variable "&lt;EM&gt;g_sd_isHostReady&lt;/EM&gt;" was Null.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Main.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99309iE9BE7E5E7F80472A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Main.PNG" alt="Main.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I tried to add function "&lt;EM&gt;sdcardWaitCardInsert()&lt;/EM&gt;" and associated files, however, it causes bus_fault and hard_fault after calling function "&lt;EM&gt;Port_SetPinInterruptConfig()&lt;/EM&gt;". I have attached several screenshots for the variables when this function is called, as well as the screenshot when I run the original sdcard_fatfs example.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Faults.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99368i0D7270A5A49813D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Faults.PNG" alt="Faults.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it caused by the conflict with USB_HOST interrupt or what?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Modified.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99822i57F84F74C54EEF72/image-size/large?v=v2&amp;amp;px=999" role="button" title="Modified.PNG" alt="Modified.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Port_SetPinInterruptConfig2_Original.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99861i522C402BB337AF72/image-size/large?v=v2&amp;amp;px=999" role="button" title="Port_SetPinInterruptConfig2_Original.PNG" alt="Port_SetPinInterruptConfig2_Original.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Before the function &lt;EM&gt;"PORT_SetPinInterruptConfig(BOARD_SDHC_CD_PORT_BASE, BOARD_SDHC_CD_GPIO_PIN, kPORT_InterruptEitherEdge);"&lt;/EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;is called,&amp;nbsp; the value of&amp;nbsp;user-&amp;gt;cd changes to 0x128cc while the original working example's value is 0xa4e8. I tracked it back, the &lt;SPAN&gt;g_sd.usrParam.cd&lt;/SPAN&gt;&amp;nbsp;is the address of s_sdCardDetect, which is automatically generated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Original SD config.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/100001iDF00F3240D612CB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="Original SD config.PNG" alt="Original SD config.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Modified SD Config (wrong).PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99823iDB62B59F69616D72/image-size/large?v=v2&amp;amp;px=999" role="button" title="Modified SD Config (wrong).PNG" alt="Modified SD Config (wrong).PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, after entering "&lt;EM&gt;PORT_SetPinInterruptConfig()",&amp;nbsp;&lt;/EM&gt;the value of some variables are null while they are all 0 in the original example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice will be helpful, thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2020 17:46:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Best-Example-for-USB-drive-to-SD-card-Writing/m-p/1007974#M3000</guid>
      <dc:creator>charles2</dc:creator>
      <dc:date>2020-03-11T17:46:01Z</dc:date>
    </item>
  </channel>
</rss>

