<?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: K64 Baremetal SD Card Read behavior in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832044#M50313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've moved to multi-block reads and timing is fine -- I just can't get the CMD12 to properly terminate CMD18.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started another thread on that subject.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Jul 2018 00:48:19 GMT</pubDate>
    <dc:creator>JHinkle</dc:creator>
    <dc:date>2018-07-22T00:48:19Z</dc:date>
    <item>
      <title>K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832038#M50307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm seeing some performance differences between micro sd cards and have found a behavior I don't understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K64 running with 120mhz clock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDHC used in SD 4bit mode - clock 40mhz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Block read acquires 1 sector of 512 bytes - polling to complete.&amp;nbsp; I have included the code below.&amp;nbsp; I added an LED to the read code so that I could acquire the trace below using a logic probe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every 25msec my application acquires around 18 sectors for the sd card (sector is 512 bytes) - I turn on the LED during this acquisition period and the trace shows LOW during the read operation.&amp;nbsp; After the 18 sectors are acquired, the sd card is not accessed until the next 25msec tic occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Behavior:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first sector read following a non-use of the SDHC - that read takes over 3msec to acquire the data.&amp;nbsp; All other reads following the first only take 400usec - a factor of 10 difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought it might be due to the SDHC clocks gating off when no sd activity so I turned gating OFF - verified by scoping the SDHC clock line.&amp;nbsp; Disabling the clock gating operation makes no change in behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please explain this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the SD card internally delaying?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a SDHC parameter that I can look into to address this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any and all comments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="SD Read.png"&gt;&lt;IMG alt="SD Read.png" src="https://community.nxp.com/t5/image/serverpage/image-id/65914i9463623C6F0867A4/image-size/large?v=v2&amp;amp;px=999" title="SD Read.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: 'Terminal'; font-size: 9.0pt; color: #000000; background-color: #ffffff; font-style: normal; font-weight: normal; text-decoration: none;"&gt;&lt;PRE&gt;[CODE]

NOTE ... 95% of the delay is in the code loop
&lt;PRE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(0 == (SDHC_PRSSTAT&amp;nbsp; &amp;amp; SDHC_PRSSTAT_BREN_MASK))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__asm__ __volatile__ ("nop");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait until reset is done

Which is waiting for the SDHC to fill it's internal 512 buffer with data from the sd card

READ_Routine:&lt;/PRE&gt;byte SDHC_ReadBlock(dword *pData, word Count) 
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; dword r = 0; 
&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; word i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dword DD, DD1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;RED_LED = 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_DLA_MASK) == 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm__ __volatile__ ("nop");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;// wait until reset is done&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDHC_IRQSTAT |= SDHC_IRQSTAT_BRR_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (SDHC_IRQSTAT &amp;amp; (SDHC_IRQSTAT_DEBE_MASK | SDHC_IRQSTAT_DCE_MASK | SDHC_IRQSTAT_DTOE_MASK))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDHC_IRQSTAT |= SDHC_IRQSTAT_DEBE_MASK | SDHC_IRQSTAT_DCE_MASK | SDHC_IRQSTAT_DTOE_MASK | SDHC_IRQSTAT_BRR_MASK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDHC_CMD12_StopTransferWaitForBusy();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDHC_Error_Displayed = SDHC_Error_Read_Block;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;RED_LED = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return RES_ERROR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(0 == (SDHC_PRSSTAT&amp;nbsp; &amp;amp; SDHC_PRSSTAT_BREN_MASK))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm__ __volatile__ ("nop");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait until reset is done&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i = 0; i &amp;lt; Count; i++)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *pData++ = SDHC_DATPORT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(SDHC_IRQSTAT &amp;amp; SDHC_IRQSTAT_TC_MASK))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait for transfer to complete&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm__ __volatile__ ("nop");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait until reset is done&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp; SDHC_IRQSTAT = (SDHC_IRQSTAT_TC_MASK | SDHC_IRQSTAT_BRR_MASK | SDHC_IRQSTAT_AC12E_MASK);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RED_LED = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background: white;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;[/CODE]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:13:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832038#M50307</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2020-11-02T14:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832039#M50308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are reading linear sector from a card you need to use CMD18 (multiple block read) in order to get best performance. The single sector read CMD17 is slower. The first read of multiple sectors is however always slower (whichever command used) since the SD cards internal logic needs to get ready - subsequent linear sector reads are then faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The uTasker SDHC card interface reads an initial sector in about 450us and subsequent ones in about 50us (using CMD18). This allows HS USB-MSD operation (eg. on K66) to achieve around 20MByte/sec transfer from the SD card to the PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3366ff;"&gt;uTasker - for more performance and faster, cheaper product development&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:18:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832039#M50308</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-19T18:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832040#M50309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last time we communicated on the SDHC - you were only using the SPI interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you switched your code to using the SDHC controller in 4-bit mode?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 18:56:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832040#M50309</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-07-19T18:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832041#M50310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark -- sanity check for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The initial delay is getting the sd card's internal up to speed - makes sense.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The remaining read times should be as fast as the card can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know CMD18 would provide a short read time over many reads but I tested my app which uses a FAT32 file system and my read requests are never on sector boundaries - so there was little advantage to CMD18.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the sanity check - It seems my actual reads (after the first are still too slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing the following math is close -- if not please correct me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently see a read of 1 sector in 350usec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that is 512 * 8 bits/byte = 4096 bits in the read package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the 4-bit interface mode so that make 1024 bus events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;350 E-6 (usec) / 1024 = 3.42 E-7 bit timing == which equates to an bus event clock of 2.93 mhz.&amp;nbsp; My SDHC clock is 40 mhz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THAT does not make sense!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on why my reads are slow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a note - my timing is AFTER issuing the CMD17 - so timing associated with is not included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2018 19:36:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832041#M50310</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-07-19T19:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832042#M50311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used SDHC since 2011 and also SPI (a configuration, or by default if the Kinetis device has no SDHC interface).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a problem with multi-block operations and the Kinetis SDHC since it can't be paused, making it impractical in environments with multiple file users that need to interrupt each other. But when this is not an issue (eg. pure USB-MSD to SD card) it is OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2018 17:11:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832042#M50311</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-21T17:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832043#M50312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With 50MHz SD card clock a read can be performed in about 20us.&lt;BR /&gt;With 25MHz it is about 40us.&lt;BR /&gt;With a little SW overhead maybe 60us.&lt;BR /&gt;&lt;BR /&gt;I use DMA for the read, which isn't that much faster since a tight loop gives about the same, but it helps if there are other interrupts that can disturb the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check that your read buffer is long word aligned - if it isn't it slow the process down since the Cortex has to split the write into multiple bus accesses and the overall operation may be &amp;gt; 4x slower.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2018 17:17:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832043#M50312</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-07-21T17:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: K64 Baremetal SD Card Read behavior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832044#M50313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've moved to multi-block reads and timing is fine -- I just can't get the CMD12 to properly terminate CMD18.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started another thread on that subject.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2018 00:48:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-Baremetal-SD-Card-Read-behavior/m-p/832044#M50313</guid>
      <dc:creator>JHinkle</dc:creator>
      <dc:date>2018-07-22T00:48:19Z</dc:date>
    </item>
  </channel>
</rss>

