<?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>Kinetis MicrocontrollersのトピックRe: K60 SDHC hanging problem</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159113#M522</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you are right. Seems that now my driver is working better. Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you also check DLA before starting writing to the sd?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marc Domingo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Oct 2011 23:13:55 GMT</pubDate>
    <dc:creator>mdomingo</dc:creator>
    <dc:date>2011-10-28T23:13:55Z</dc:date>
    <item>
      <title>K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159109#M518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;BR /&gt;&lt;BR /&gt;Has anyone had a problem that the SDHC gets blocked?&lt;BR /&gt;When doing&amp;nbsp; tests I sometimes get the following while loop waiting forever:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;while (!(SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_BREN)) {}&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;This is performed in the read of a sector (not using DMA) of 512 bytes (actually 128 long words at the SDHC interface). The &lt;STRONG&gt;BREN&lt;/STRONG&gt; flag indicates that there are bytes to be read and the problem always occurs when 127 long word reads have been made and there is never a flag to say that the final one is ready.&lt;BR /&gt;&lt;BR /&gt;When this happens there are no data error bits set in the &lt;STRONG&gt;SDHC_IRQSTAT&lt;/STRONG&gt; register.&lt;BR /&gt;&lt;BR /&gt;The value of &lt;STRONG&gt;SDHC_PRSSTAT&lt;/STRONG&gt; is &lt;STRONG&gt;0xff88020a&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;This is the routine:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;// Read a sector from SD card into the specified data buffer//extern int fnGetSector(unsigned char *ptrBuf){    unsigned long *ptrData = (unsigned long *)ptrBuf;                    // the Kinetis driver ensures that the buffer is long word aligned    int i = (512/sizeof(unsigned long));    while (i--) {        if (SDHC_IRQSTAT &amp;amp; (SDHC_IRQSTAT_DEBE | SDHC_IRQSTAT_DCE | SDHC_IRQSTAT_DTOE)) { // check for read errors            SDHC_IRQSTAT = (SDHC_IRQSTAT_DEBE | SDHC_IRQSTAT_DCE | SDHC_IRQSTAT_DTOE | SDHC_IRQSTAT_BRR);            return UTFAT_DISK_READ_ERROR;                                // return error        }        while (!(SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_BREN)) {             &amp;lt;---------- gets stuck here        }        *ptrData++ = SDHC_DATPORT;    }    while (!(SDHC_IRQSTAT &amp;amp; SDHC_IRQSTAT_TC)) {                          // wait for transfer to complete    }    SDHC_IRQSTAT = (SDHC_IRQSTAT_TC | SDHC_IRQSTAT_BRR | SDHC_IRQSTAT_AC12E); // reset flags    return UTFAT_SUCCESS;                                                // read successfully terminated}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This seems quite a standard/typical realisation. The following subtle effects have also been noticed:&lt;BR /&gt;1) When built with GCC it hangs very often when the &lt;STRONG&gt;SDHC_IRQSTAT&lt;/STRONG&gt; check before it is removed. With the check in position it seems to be stable.&lt;BR /&gt;2) When built with CW10.1 it gets stuck quite often, even with the &lt;STRONG&gt;SDHC_IRQSTAT&lt;/STRONG&gt; check before the line.&lt;BR /&gt;&lt;BR /&gt;Therefore the stability is compiler/timing dependent (all registers are declared as volatile).&lt;BR /&gt;&lt;BR /&gt;Has anyone else encountered such a behaviour?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;P.S. During the test the SD card is used by various sources (to display images to the TFT display (file system reads), for USB-MSD (PC reads) and for serving pages at web server (web server file reads). It is easier to reproduce when all are working together but still happens when only one read source is actually active (although less frequently). Accesses are however protected so only one source actually physically reads at a time.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159109#M518</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T09:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159110#M519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may have been able to solve this by adding the following before starting the read:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while (SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_DLA) ﻿{}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This ensures that the previous command has completely terminated before checking for the read data. There is obviously a short time where the command hasn't completely terminated but the FIFO can flag that there is something there (or something similar). This would explain why the compiler (with slightly different optimisation and delays) could be more or less affected. In fact, using IAR (faster code) it was even worst before and then stable afterward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 04:21:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159110#M519</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2011-08-15T04:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159111#M520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you sure that line solves your problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I mean, I think you are checking the wrong value. From the datasheet:&lt;/P&gt;&lt;P&gt;"In the case of read transactions:&lt;BR /&gt;This bit will be set in either of the following cases:&lt;BR /&gt;• After the end bit of the read command.&lt;/P&gt;&lt;P&gt;..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, I think you should check:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_DLA_MASK)==0){};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But anyway, sometimes I still have the same problem.&lt;/P&gt;&lt;P&gt;Someone has any idea where should be the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marc Domingo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159111#M520</guid>
      <dc:creator>mdomingo</dc:creator>
      <dc:date>2011-10-20T14:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159112#M521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have understood that the DLA indicates that the data line(s) is/are active. It is set when a read or write is in operation and cleared when the operation has been completed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By adding&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;while (SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_DLA) ﻿{}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;'before' starting the read it is verifying that any 'previous' operation has completely terminated. If the tail end of any previous activity happens to still not be completely termianted the start of the new read will be delayed until it is (the DLA returns back to '0').&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since adding this I haven't had a hang take place so it looks to be doing something positive but I never did any measurements with an analyser connected to the bus and some indication of where the code was; whether the wait took place and how long, etc. (&lt;EM&gt;which I would do in case of any further difficulties&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My feeling is that the difficulty occurs when a read quickly follows another operation, whereby the bus has not fully completed what it was doing before the new read is started. I also expect that by simply adding a short delay (say a couple fo us) at the start of the read function would also give the bus time to complete and so would stop the hanging situation arise, which is presumably because new commands are issued a bit too soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could however be completely wrong, so if you can confirm something else it would also be useful :smileywink:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 03:17:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159112#M521</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2011-10-21T03:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159113#M522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you are right. Seems that now my driver is working better. Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you also check DLA before starting writing to the sd?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marc Domingo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 23:13:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159113#M522</guid>
      <dc:creator>mdomingo</dc:creator>
      <dc:date>2011-10-28T23:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159114#M523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't need to change anything when writing (yet...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2011 04:01:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159114#M523</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2011-10-29T04:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159115#M524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark (and others)&lt;/P&gt;&lt;P&gt;I know that this tread is old and solved, but I have a concern about the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just copy the inner loop&lt;/P&gt;&lt;PRE&gt;{        if (&lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT &amp;amp; (&lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_DEBE | &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_DCE | &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_DTOE)) {             &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT = (&lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_DEBE | &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_DCE | &lt;SPAN&gt;
 SDHC&lt;/SPAN&gt;_IRQSTAT_DTOE | &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_BRR   );            return UTFAT_DISK_READ_ERROR;                                // return error        }       &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;while (!(&lt;SPAN&gt;SDHC&lt;/SPAN&gt;_PRSSTAT &amp;amp; &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_PRSSTAT_BREN)) { }&lt;/FONT&gt;&lt;/STRONG&gt;        *ptrData++ = &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_DATPORT;  }    while (!(&lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT &amp;amp; &lt;SPAN&gt;SDHC&lt;/SPAN&gt;_IRQSTAT_TC)) {  }                       // wait for transfer to complete   &lt;/PRE&gt;&lt;P&gt;I do not&amp;nbsp; underestand why you did not check errors inside &lt;EM&gt;while loop&lt;/EM&gt; as follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; while (!(SDHC_PRSSTAT &amp;amp; SDHC_PRSSTAT_BREN)) {&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (SDHC_IRQSTAT &amp;amp; (SDHC_IRQSTAT_DEBE | SDHC_IRQSTAT_DCE | SDHC_IRQSTAT_DTOE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDHC_IRQSTAT = (SDHC_IRQSTAT_DEBE | SDHC_IRQSTAT_DCE |&lt;BR /&gt;&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; SDHC_IRQSTAT_DTOE | SDHC_IRQSTAT_BRR&amp;nbsp;&amp;nbsp; );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return UTFAT_DISK_READ_ERROR;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; // return error&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; *ptrData++ = SDHC_DATPORT; &amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;while (!(SDHC_IRQSTAT &amp;amp; SDHC_IRQSTAT_TC)) {&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; // wait for transfer to complete&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159115#M524</guid>
      <dc:creator>JOliverasC</dc:creator>
      <dc:date>2020-10-29T09:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159116#M525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where can I get this SDHC driver code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Richard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 12:28:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159116#M525</guid>
      <dc:creator>T_M_F</dc:creator>
      <dc:date>2012-01-05T12:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159117#M526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN&gt;&lt;A href="http://forums.freescale.com/../user/viewprofilepage/user-id/25771" rel="nofollow" target="_self"&gt;&lt;SPAN&gt;JOliverasC&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The reason why the check for errors is not performed in the while loop is because the while loop is entered very rarely - normally the BREN flag is set and so the error check would not be made at all.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The question as to whether the error check should be before AND in the while loop is another one. This may be the best but the wait loop by itself hasn't represented a problem in any cases to date.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;In fact a &lt;STRONG&gt;do {error_check} while (BREN not set)&lt;/STRONG&gt; may be the best solution. In practice I never actually had an error and there may be other waits which could potentially be improved by checking for errors while waiting. The exact internal workings of the SDHC is not documented in such detail that one can see in what order things take place and what can happen while other things are in progress and so there is a certain amount of trial and error involved - sometimes with a code hang during initial testing (which does however help to get some insights into what can take place).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Mark&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 08:20:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159117#M526</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2012-01-06T08:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159118#M527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The particular code referenced here is from the uTasker project for Kinetis: &lt;A href="http://www.utasker.com/forum/index.php?topic=1252.0" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=1252.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 08:24:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159118#M527</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2012-01-06T08:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159119#M528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark!&lt;/P&gt;&lt;P&gt;Have you used the multiple_block read?&lt;/P&gt;&lt;P&gt;When I use it ,I fond it often could 't stop,and BCEN unnormal.It often read wrong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 10:50:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159119#M528</guid>
      <dc:creator>SDK</dc:creator>
      <dc:date>2012-03-15T10:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: K60 SDHC hanging problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159120#M529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry but I never used the multi-block command; just the single block command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2012 19:06:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K60-SDHC-hanging-problem/m-p/159120#M529</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2012-03-19T19:06:23Z</dc:date>
    </item>
  </channel>
</rss>

