<?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: SD card write problem on LPC54608 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2196237#M58941</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/157304"&gt;@jaf_developer74&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks for sharing your testing results with different brands of cards. It's invaluable.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jun Zhang&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Oct 2025 02:14:42 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2025-10-31T02:14:42Z</dc:date>
    <item>
      <title>SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2193650#M58926</link>
      <description>&lt;P&gt;based on the sdmmc polling example and usb vcom cdc example, I developed a program to read data from USB and write to the SD card. The program works flawlessly with some SD cards vendors such as samsung, but not with other venders such as unbranded Taiwan mde 8GB sd card.&lt;/P&gt;&lt;P&gt;The unbranded card works perfectly and reliably in Windows and Linux without&amp;nbsp; any problems. The hardware I use is LPCXpresso54608.&lt;/P&gt;&lt;P&gt;The problem is as follow:&lt;/P&gt;&lt;P&gt;-when block write commands (single or multiple) is used, it works flawlessly up to 16 write operation.&lt;/P&gt;&lt;P&gt;-After the 16 operation, the SD accept written data without any error or delay, the readback also show the correct data.&lt;/P&gt;&lt;P&gt;-When the power is cut or card is removed, the written data (beyond the 16 write operations) is lost and old data is found instead.&lt;/P&gt;&lt;P&gt;Investigation done:&lt;/P&gt;&lt;P&gt;-Changed SD clock down to 1M&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Try writing in chunks of different block count (2, 4, 8, 16, 32) or single block&lt;/P&gt;&lt;P&gt;-Activated ACDM23 to define number of blocks to be erased before writting&lt;/P&gt;&lt;P&gt;-Wait for long time (2 hours) before power cut&lt;/P&gt;&lt;P&gt;problem not solved.&lt;/P&gt;&lt;P&gt;It seems that sd card controller caches the data in its buffer and never flush it to the nand, after the first successful 16-write-operation, which seems strange.&lt;/P&gt;&lt;P&gt;I wonder if there is a specific vender command that tells the controller to flush the written data. Why Windows and Linux driver works without problem, may be there is a secret vender-specific command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know there are cards with reputable venders which overcome this problem but would like to develop a hardware wich can be used with any sd card including low-price cards.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 17:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2193650#M58926</guid>
      <dc:creator>jaf_developer74</dc:creator>
      <dc:date>2025-10-27T17:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2194267#M58930</link>
      <description>&lt;P&gt;Hi&amp;nbsp;jaf_developer74，&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Some low cost SD cards in order to have faster speed, once they receive data, they instantly report the write as complete, but in reality, the data is only temporarily stored in the card’s internal RAM cache and only gets properly written to the flash later. If the power cuts out at this point, the data in the cache will be lost.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So I suggest you using COM13 after each writing to make sure the internal operation is done.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1761648378913.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/362888iDD86D33B2631B771/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1761648378913.png" alt="ZhangJennie_0-1761648378913.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 10:47:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2194267#M58930</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-10-28T10:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2194407#M58931</link>
      <description>&lt;P&gt;Hi Jun Zhang,&lt;BR /&gt;Thank you for your input. I already tried sending CMD13 after write and also CMD7 as per LPC datasheet recommend. No change.&lt;/P&gt;&lt;P&gt;I have also added delays between writes without sucess. I think there is a magic command windows and Linux send after file or floder access which forces the sd to program its cached data. Maybe manual erasing one or more dummy blocks by&amp;nbsp;SD_EraseBlocks() will trigger the lazy sd controller to start programming. Do you think filesystem do such thing while updating FAT?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 15:42:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2194407#M58931</guid>
      <dc:creator>jaf_developer74</dc:creator>
      <dc:date>2025-10-28T15:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2195065#M58933</link>
      <description>&lt;P&gt;Hi&amp;nbsp;jaf_developer74,&lt;/P&gt;
&lt;P&gt;Did SD card return the ready status after sending CMD13?&lt;/P&gt;
&lt;P&gt;How does it work if explicit flush by CMD38 to triger SD card?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I don't think windows/linux use magic command. All the available commands are listed here:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1761735224469.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/363077i0502AEE05F56A781/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1761735224469.png" alt="ZhangJennie_0-1761735224469.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 10:57:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2195065#M58933</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-10-29T10:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2196069#M58938</link>
      <description>&lt;P&gt;Hi Jun Zhang,&lt;/P&gt;&lt;P&gt;Thank you for your follow-up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sending CMD13 command returns the sd card is not busy (DAT0 is not pulled low) and also it is ready for communication (trans state).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have figured out that manually erasing a dummy block with CMD32, CMD33 and CMD38, by calling SD_Erase function, triggers the lazy contoller and force it to flush bufferd data. This is not a perfect solution but suffice right now to deal with the lazy cards.&lt;/P&gt;&lt;P&gt;Cards tested:&lt;/P&gt;&lt;P&gt;SanDisk : No problem&lt;/P&gt;&lt;P&gt;Samsung: No problem&lt;/P&gt;&lt;P&gt;Kingston: No problem&lt;/P&gt;&lt;P&gt;Unbranded (made in Taiwan) 8GB and 2GB: problematic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 18:48:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2196069#M58938</guid>
      <dc:creator>jaf_developer74</dc:creator>
      <dc:date>2025-10-30T18:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: SD card write problem on LPC54608</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2196237#M58941</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/157304"&gt;@jaf_developer74&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks for sharing your testing results with different brands of cards. It's invaluable.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jun Zhang&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 02:14:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SD-card-write-problem-on-LPC54608/m-p/2196237#M58941</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-10-31T02:14:42Z</dc:date>
    </item>
  </channel>
</rss>

