<?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 reading/writing SDCARD using USB in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532763#M10464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by GuusReijnders_CG on Tue Jul 29 05:18:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the development board MCB1800 (lp1856) from Keil.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can compile and the examples usb_rom_msc_ram and periph_sdmmc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the first example uses RAM instead of an SDCARD, so I want to combine these two examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can read the number of sector and size of the SDCARD, so I can set the right settings for USB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In windows the right size of the SDCARD is shown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But now I want to read and write the Card using USB. I see the functions translate_rd and translate_wr.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried several things but nothing is working yet. What code do I need to add to let the SDCARD work with USB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen the gunctions diskr_read and disk_write. However when I use these functions in the USB routines the application gangs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:18:51 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:18:51Z</dc:date>
    <item>
      <title>reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532763#M10464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by GuusReijnders_CG on Tue Jul 29 05:18:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the development board MCB1800 (lp1856) from Keil.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can compile and the examples usb_rom_msc_ram and periph_sdmmc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the first example uses RAM instead of an SDCARD, so I want to combine these two examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can read the number of sector and size of the SDCARD, so I can set the right settings for USB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In windows the right size of the SDCARD is shown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But now I want to read and write the Card using USB. I see the functions translate_rd and translate_wr.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried several things but nothing is working yet. What code do I need to add to let the SDCARD work with USB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen the gunctions diskr_read and disk_write. However when I use these functions in the USB routines the application gangs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532763#M10464</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532764#M10465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by goffi on Wed Jul 30 01:11:46 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Few weeks ago i tried to do the same things with my lpc1837 (just for fun), using two examples (msc and sdcard example). I mixed both and it worked.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532764#M10465</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532765#M10466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Erwins on Wed Jul 30 06:38:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi goffi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Great to hear you had it working!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm also trying to get MSC on the SD Card running on the LPC1857.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to merge msc_ram and periph_sdmmc examples.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When calling disk_read() from the main loop, it works fine. If disk_read() is called from the translate_rd() USB call back function, the program hangs in sdmmc_irq_driven_wait(), in the while loop:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
while (sdio_wait_exit == 0) {}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently the SDIO IRQ doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532765#M10466</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532766#M10467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by goffi on Fri Aug 01 08:06:32 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;i lose about two hours to understand and fix that problem!! :(( &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532766#M10467</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532767#M10468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TaGUNil on Fri Aug 01 08:33:52 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It's about interrupt priorities. Mass Storage callbacks are called inside USB interrupt handler. Therefore you should set SD/MMC interrupt priority higher than USB's.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532767#M10468</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532768#M10469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by goffi on Fri Aug 01 12:47:50 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;right!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532768#M10469</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532769#M10470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Erwins on Sun Aug 03 22:43:25 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your replies! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We also figured out the interrupt problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532769#M10470</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532770#M10471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Erwins on Sun Aug 03 22:45:38 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your replies! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We also figured out the interrupt problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532770#M10471</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532771#M10472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by schisanoa on Sun Aug 17 07:17:15 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to do the same thing but with a LPC4088, the first part seems to be ok, the pc recognize the Mass Storage Device when connected over USB, but what about the function to be wrapped?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static void translate_rd(uint32_t offset, uint8_t * *buff_adr, uint32_t length, uint32_t hi_offset)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*buff_adr =&amp;nbsp; &amp;amp;g_memDiskArea[(((uint64_t) offset) | (((uint64_t) hi_offset) &amp;lt;&amp;lt; 32))];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* USB device mass storage class write callback routine */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;static void translate_wr(uint32_t offset, uint8_t * *buff_adr, uint32_t length, uint32_t hi_offset)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *buff_adr =&amp;nbsp; &amp;amp;g_memDiskArea[(((uint64_t) offset) | (((uint64_t) hi_offset) &amp;lt;&amp;lt; 32)) + length];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* USB device mass storage class get write buffer callback routine */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;static void translate_GetWrBuf(uint32_t offset, uint8_t * *buff_adr, uint32_t length, uint32_t hi_offset)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*buff_adr =&amp;nbsp; &amp;amp;g_memDiskArea[(((uint64_t) offset) | (((uint64_t) hi_offset) &amp;lt;&amp;lt; 32))];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* USB device mass storage class verify callback routine */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;static ErrorCode_t translate_verify(uint32_t offset, uint8_t *src, uint32_t length, uint32_t hi_offset)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (memcmp((void *) &amp;amp;g_memDiskArea[(((uint64_t) offset) | (((uint64_t) hi_offset) &amp;lt;&amp;lt; 32))], src, length)) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return ERR_FAILED;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;return LPC_OK;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How I should replace the function?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532771#M10472</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: reading/writing SDCARD using USB</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532772#M10473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ChewTP on Wed Oct 15 02:40:24 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi I need some help here . I would like to implement SDMMC as a Mass storage device media when connected to the PC . I am looking at the msc_ram and perish_sdmmc examples in the LPCOpen . Same examples that you are looking . I would like to implement read , write , change directory , rename in the SDMMC card when view from PC . &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think using the USBD ROM driver in the mass storage class , they only have translate_wr , translate_rd , verify ..etc but with just these two callback function , how can I implement those functionn like change directory , rename delete ... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it can implement read and write but to use it like a normal storage device , it is more than just read and write . Any idea how to do that .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:18:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/reading-writing-SDCARD-using-USB/m-p/532772#M10473</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:18:57Z</dc:date>
    </item>
  </channel>
</rss>

