<?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>LPC MicrocontrollersのトピックSD card test</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-test/m-p/522210#M4846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wella-tabor on Fri May 24 08:34:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am facing problems with my SD MMC driver(not only mine) and 4 bit configuration. Is someone willing to try the following test with his/her driver and posts results? The clock is from 1MHz to XXMhz, 4 bit configuration. You need to replace the init, read,write and error check functions of course. You should use CMD12 (STOP command) and the read/write burst should be e.g. 8.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Best Martin&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;BR /&gt;&lt;BR /&gt;static uint8_t buffer[512*32];&lt;BR /&gt;#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))&lt;BR /&gt;&lt;BR /&gt;#define SECTOR_BURST_MAX (23)&lt;BR /&gt;#define BLOCK_SIZE (512)&lt;BR /&gt;&lt;BR /&gt;const unsigned int sector_bursts[] = {1,2,3,7,16,17,20, SECTOR_BURST_MAX};&lt;BR /&gt;const unsigned int sector_addresses[] =&lt;BR /&gt;{ 0, 1, 23, 500, 1235, 10689, 39784 };&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;int error;&lt;BR /&gt;mmc_init(); // pseudo function, put your code here&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// write&lt;BR /&gt;for (unsigned i = 0; i &amp;lt; SIZE_OF_ARRAY(sector_addresses); ++i)&lt;BR /&gt;{&lt;BR /&gt;for (unsigned j = 0; j &amp;lt; SIZE_OF_ARRAY(sector_bursts); ++j)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;//fill buffer to a known number.&lt;BR /&gt;memset(buffer, (i+1)*(j+1), BLOCK_SIZE * sector_bursts[j]);&lt;BR /&gt;&lt;BR /&gt;error =mmc_write(buffer,sector_addresses&lt;I&gt;, sector_bursts[j]);&lt;BR /&gt;if(error != ERR_OK)&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;//clear buffer.&lt;BR /&gt;memset(buffer, 0, BLOCK_SIZE * sector_bursts[j]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//read block&lt;BR /&gt;error =mmc_read(buffer,sector_addresses&lt;I&gt;, sector_bursts[j]);&lt;BR /&gt;if(error != ERR_OK)&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Here comes checking&lt;BR /&gt;for (unsigned k = 0; k &amp;lt; BLOCK_SIZE * sector_bursts[j]; ++k)&lt;BR /&gt;{&lt;BR /&gt;if (buffer[k] != (i+1)*(j+1))&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;}&amp;lt;/code&amp;gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 16:37:28 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T16:37:28Z</dc:date>
    <item>
      <title>SD card test</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-test/m-p/522210#M4846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wella-tabor on Fri May 24 08:34:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am facing problems with my SD MMC driver(not only mine) and 4 bit configuration. Is someone willing to try the following test with his/her driver and posts results? The clock is from 1MHz to XXMhz, 4 bit configuration. You need to replace the init, read,write and error check functions of course. You should use CMD12 (STOP command) and the read/write burst should be e.g. 8.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Best Martin&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;lt;code&amp;gt;&lt;BR /&gt;&lt;BR /&gt;static uint8_t buffer[512*32];&lt;BR /&gt;#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))&lt;BR /&gt;&lt;BR /&gt;#define SECTOR_BURST_MAX (23)&lt;BR /&gt;#define BLOCK_SIZE (512)&lt;BR /&gt;&lt;BR /&gt;const unsigned int sector_bursts[] = {1,2,3,7,16,17,20, SECTOR_BURST_MAX};&lt;BR /&gt;const unsigned int sector_addresses[] =&lt;BR /&gt;{ 0, 1, 23, 500, 1235, 10689, 39784 };&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;int error;&lt;BR /&gt;mmc_init(); // pseudo function, put your code here&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// write&lt;BR /&gt;for (unsigned i = 0; i &amp;lt; SIZE_OF_ARRAY(sector_addresses); ++i)&lt;BR /&gt;{&lt;BR /&gt;for (unsigned j = 0; j &amp;lt; SIZE_OF_ARRAY(sector_bursts); ++j)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;//fill buffer to a known number.&lt;BR /&gt;memset(buffer, (i+1)*(j+1), BLOCK_SIZE * sector_bursts[j]);&lt;BR /&gt;&lt;BR /&gt;error =mmc_write(buffer,sector_addresses&lt;I&gt;, sector_bursts[j]);&lt;BR /&gt;if(error != ERR_OK)&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;//clear buffer.&lt;BR /&gt;memset(buffer, 0, BLOCK_SIZE * sector_bursts[j]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;//read block&lt;BR /&gt;error =mmc_read(buffer,sector_addresses&lt;I&gt;, sector_bursts[j]);&lt;BR /&gt;if(error != ERR_OK)&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Here comes checking&lt;BR /&gt;for (unsigned k = 0; k &amp;lt; BLOCK_SIZE * sector_bursts[j]; ++k)&lt;BR /&gt;{&lt;BR /&gt;if (buffer[k] != (i+1)*(j+1))&lt;BR /&gt;{&lt;BR /&gt; //do something&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;while(1)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;}&amp;lt;/code&amp;gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 16:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-test/m-p/522210#M4846</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T16:37:28Z</dc:date>
    </item>
  </channel>
</rss>

