<?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: Help with MQX SDHC support on TWRK60F120M in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363468#M1876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to say, I'm using the latest versions of everything... CodeWarrior 10.6, MQX4.1 etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Nov 2014 19:32:22 GMT</pubDate>
    <dc:creator>andrewclegg</dc:creator>
    <dc:date>2014-11-23T19:32:22Z</dc:date>
    <item>
      <title>Help with MQX SDHC support on TWRK60F120M</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363467#M1875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am getting really stuck with trying to use the built in SDHC slot on the TWRK60F120M. I am trying to use MQX IO drivers for direct block-level access, rather than with MFS.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try to initialize the SD card support with ProcessorExpert (either SDHC_LDD or Init_SDHC), then I can use the MQX IO driver to open the device:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;MQX_FILE_PTR com_handle = fopen(BSP_SDCARD_ESDHC_CHANNEL, NULL); _io_sdcard_install("sdcard:", (void *)&amp;amp;_bsp_sdcard0_init, com_handle); sd_card_ptr = fopen("sdcard:", 0); uint32_t num_sectors; _io_ioctl(sd_card_ptr, IO_IOCTL_GET_NUM_SECTORS, &amp;amp;num_sectors); _io_write(sd_card_ptr, &amp;amp;current_data_block, 512);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;This is minimalised code, my real version has error checking etc. I get an sd_card_ptr which is not null. The IOCTL command runs, but the num_sectors is not correct. The _io_write call fails (returns IO_ERROR_WRITE).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I don't use either of the ProcessorExpert components, then the 3rd line (fopen("sdcard:", 0)) fails.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is - am I doing anything really stupid here? Do I need the processor expert components to initialize the card, or is this just causing problems? Is it OK to read/write directly to the card without going through MFS? Is there a better way of doing this - all I really need to do is read and write 512 byte blocks to the card?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2014 19:19:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363467#M1875</guid>
      <dc:creator>andrewclegg</dc:creator>
      <dc:date>2014-11-23T19:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MQX SDHC support on TWRK60F120M</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363468#M1876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to say, I'm using the latest versions of everything... CodeWarrior 10.6, MQX4.1 etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Nov 2014 19:32:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363468#M1876</guid>
      <dc:creator>andrewclegg</dc:creator>
      <dc:date>2014-11-23T19:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MQX SDHC support on TWRK60F120M</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363469#M1877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESDHC device driver provides an installation function _esdhc_install() that either the BSP or the application calls. The function then calls _io_dev_install_ext() internally. Installation function creates internal structures within MQX I/O subsystem and makes the driver available for public use.&lt;/P&gt;&lt;P&gt;So, you don´t need to use processor expert.&lt;/P&gt;&lt;P&gt;MFS is a device driver that an application must install over a lower-level device driver. Examples of lower-level drivers are drivers for memory devices, flash disks, floppy disks, or partition-manager devices etc.&lt;/P&gt;&lt;P&gt;MFS uses the lower-level driver to access the hardware device.&lt;/P&gt;&lt;P&gt;MFS functions do the following:&lt;/P&gt;&lt;P&gt;• Traverse MS-DOS directory structure.&lt;/P&gt;&lt;P&gt;• Create and remove subdirectories.&lt;/P&gt;&lt;P&gt;• Find files.&lt;/P&gt;&lt;P&gt;• Create and delete files.&lt;/P&gt;&lt;P&gt;• Open and close files.&lt;/P&gt;&lt;P&gt;• Read from files and write to files.&lt;/P&gt;&lt;P&gt;• View and modify file characteristics.&lt;/P&gt;&lt;P&gt;• Get the amount of free space in the file system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use this functions then you need to use MFS.&lt;/P&gt;&lt;P&gt;You can find an example that you can use as reference,&amp;nbsp; at the path C:\Freescale\Freescale_MQX_4_1\mfs\examples\sdcard&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 17:34:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-with-MQX-SDHC-support-on-TWRK60F120M/m-p/363469#M1877</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2014-11-27T17:34:01Z</dc:date>
    </item>
  </channel>
</rss>

