<?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>MQX Software Solutions中的主题 SD Shell_write_test hangs on 512 byte</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334685#M10776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone used the Shell_write_test command with an SD card or eMMC?&amp;nbsp; In both cases I see problems when writing a 512 byte buffer.&amp;nbsp; 512 bytes happens to be the sector size.&amp;nbsp; The DLA bit in PRSSTAT is not clearing.&amp;nbsp; I named the command "writetest" in my shell.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shell&amp;gt; writetest test&lt;/P&gt;&lt;P&gt;Test Iteration #8 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #16 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #32 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #64 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #128 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #256 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #512 Error, unable to open file to read&lt;/P&gt;&lt;P&gt;shell&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2014 17:10:46 GMT</pubDate>
    <dc:creator>pbanta</dc:creator>
    <dc:date>2014-11-12T17:10:46Z</dc:date>
    <item>
      <title>SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334685#M10776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone used the Shell_write_test command with an SD card or eMMC?&amp;nbsp; In both cases I see problems when writing a 512 byte buffer.&amp;nbsp; 512 bytes happens to be the sector size.&amp;nbsp; The DLA bit in PRSSTAT is not clearing.&amp;nbsp; I named the command "writetest" in my shell.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shell&amp;gt; writetest test&lt;/P&gt;&lt;P&gt;Test Iteration #8 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #16 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #32 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #64 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #128 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #256 Passed&lt;/P&gt;&lt;P&gt;Test Iteration #512 Error, unable to open file to read&lt;/P&gt;&lt;P&gt;shell&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 17:10:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334685#M10776</guid>
      <dc:creator>pbanta</dc:creator>
      <dc:date>2014-11-12T17:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334686#M10777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that you found already known issue.&lt;/P&gt;&lt;P&gt;I suppose that you use append mode.&lt;/P&gt;&lt;P&gt;Unfortunately, append mode is implemented wrongly.&lt;/P&gt;&lt;P&gt;Problem with append mode appears when file size is multiply of cluster size. See also:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-message-small" data-containerid="2023" data-containertype="14" data-objectid="441854" data-objecttype="2" href="https://community.freescale.com/message/441854#441854"&gt;https://community.freescale.com/message/441854&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As workaround, please use r+/w/w+ modes instead of append mode and seeks manually according your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next MQX release will contain complete redesigned MFS subsystem which will solve this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;RadekS&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>Wed, 12 Nov 2014 18:56:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334686#M10777</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2014-11-12T18:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334687#M10778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took a look at the source code for Shell_write_test and it opens file in "w" mode.&amp;nbsp; The bug may not be only with append mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 19:30:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334687#M10778</guid>
      <dc:creator>pbanta</dc:creator>
      <dc:date>2014-11-12T19:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334688#M10779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done more investigation on this issue.&amp;nbsp; It looks like the problem is in the sdcard/esdhc drivers.&amp;nbsp; The problem happens on the first write to a new file.&amp;nbsp; The buffer to write is 512 bytes.&amp;nbsp; It is 1 block in the SD card.&amp;nbsp; The driver issues a CMD24.&amp;nbsp; In _esdhc_write() when the buffered CMD24 is finally sent to the device there is an ESDHC_LWEVENT_TRANSFER_ERROR.&amp;nbsp; In the code below from _esdhc_write(),&amp;nbsp; should line 5 be&lt;STRONG style=": ; color: #ff0000; font-size: 12pt;"&gt; &amp;gt;=&lt;/STRONG&gt; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14158366608123476" jivemacro_uid="_14158366608123476"&gt;
&lt;P&gt;if(_lwevent_get_signalled() &amp;amp; ESDHC_LWEVENT_TRANSFER_ERROR)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; esdhc_ptr-&amp;gt;SYSCTL |= SDHC_SYSCTL_RSTD_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(esdhc_device_ptr-&amp;gt;BUFFERED_CMD.BLOCKS &amp;gt; 1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* In this case the peripheral doesn't automatically send the CMD12, so MUST be sent manually */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESDHC_COMMAND_STRUCT command;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.COMMAND = ESDHC_CREATE_CMD(12, ESDHC_COMMAND_TYPE_NORMAL, ESDHC_COMMAND_RESPONSE_R1b, (ESDHC_COMMAND_NONE_FLAG));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.ARGUMENT = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.BLOCKS = 0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _esdhc_send_command(esdhc_device_ptr, &amp;amp;command, NULL);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Don't care about the result because the operation ends always by IO_ERROR. */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return IO_ERROR;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 00:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334688#M10779</guid>
      <dc:creator>pbanta</dc:creator>
      <dc:date>2014-11-13T00:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334689#M10780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your bug report.&lt;/P&gt;&lt;P&gt;I could confirm that writetest function has problem with write more than 511 bytes (511 works, 512 and more not work).&lt;/P&gt;&lt;P&gt;It has nothing to do with FAT sector size. The problem is the same even when sector size is 8196bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It must be probably somehow connected to SD card block size.&lt;/P&gt;&lt;P&gt;Strange is that standard write function (Shell_write) doesn’t suffer by this issue. Till now I didn’t found root cause of this issue. I will report it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Your modification in esdhc.c file didn't help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 16:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334689#M10780</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2014-11-13T16:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: SD Shell_write_test hangs on 512 byte</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334690#M10781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radek,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Thank you for doing more investigation.&amp;nbsp; I have new information to report today.&amp;nbsp; I set a breakpoint in the _edshc_isr() function and I'm getting a DMA error when I try to write a single buffer of 512bytes.&amp;nbsp; (See line 12 in code below.) 512 is the sector size of the device. It doesn't matter if the device is microSD or eMMC. (I have a board with microSD and another board with eMMC.)&amp;nbsp; That tells me it's a K70 issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14159145097256763" jivemacro_uid="_14159145097256763"&gt;
&lt;P&gt;&amp;nbsp; /*&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA Error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Occurs when an Internal DMA transfer has failed. This bit is set to 1, when some error occurs in the data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; transfer. This error can be caused by either Simple DMA or ADMA, depending on which DMA is in use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The value in DMA System Address register is the next fetch address where the error occurs. Since any&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; error corrupts the whole data block, the host driver shall re-start the transfer from the corrupted block&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; boundary. The address of the block boundary can be calculated either from the current DSADDR value or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from the remaining number of blocks and the block size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if((esdhc_ptr-&amp;gt;IRQSIGEN &amp;amp; SDHC_IRQSIGEN_DMAEIEN_MASK) &amp;amp;&amp;amp; (sdhc_irqstat &amp;amp; SDHC_IRQSTAT_DMAE_MASK))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lwevent_set( &amp;amp;esdhc_device_ptr-&amp;gt;LWEVENT, ESDHC_LWEVENT_TRANSFER_ERROR);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 21:37:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/SD-Shell-write-test-hangs-on-512-byte/m-p/334690#M10781</guid>
      <dc:creator>pbanta</dc:creator>
      <dc:date>2014-11-13T21:37:25Z</dc:date>
    </item>
  </channel>
</rss>

