<?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>MCUXpresso SDKのトピックRe: SDIF driver invalid error handling</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027383#M2185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN class=""&gt;Felipe, thank you for the reply. I can reproduce this by removing the SD card&lt;/SPAN&gt; during the write to the file. This causes a timeout and SD_StopTransmission() being issued, which sets handle-&amp;gt;data to null and following interrupt is trying to handle the data write SDIF_TransferHandleData() which expects handle-&amp;gt;data not being null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those 2 stacked calls are simply in collision.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Dec 2019 11:12:37 GMT</pubDate>
    <dc:creator>tomasvavra</dc:creator>
    <dc:date>2019-12-02T11:12:37Z</dc:date>
    <item>
      <title>SDIF driver invalid error handling</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027381#M2183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using SDK 2.6.0 with LPCExpresso54618 and running an example lpcxpresso54618_fatfs_sdcard_fatfs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the write to the card timeouts or fail for any reason, then i run into an assert in SDIF_TransferHandleData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1404: assert(handle-&amp;gt;data);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reason for this is interruptFlags &amp;amp; kSDIF_DataTransferStatus is true in SDIF_TransferHandleIRQ but handle-&amp;gt;data was already set to NULL by SD_StopTransmission (SDIF_TransferNonBlocking).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How reliable is this driver?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My stack:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lpcxpresso54618_fatfs_sdcard_fatfs LinkServer Debug [C/C++ (NXP Semiconductors) MCU Application]&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lpcxpresso54618_fatfs_sdcard_fatfs.axf [LPC54618J512 (cortex-m4)]&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Thread #1 1 (Suspended : Signal : SIGQUIT:Quit)&amp;nbsp;&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;__sys_appexit() at 0x6878&amp;nbsp;&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;SDIF_TransferHandleData() at fsl_sdif.c:1,404 0x5e06&amp;nbsp;&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;SDIF_TransferHandleIRQ() at fsl_sdif.c:1,521 0x5f96&amp;nbsp;&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;SDIO_DriverIRQHandler() at fsl_sdif.c:1,566 0x600c&amp;nbsp;&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;SDIO_IRQHandler() at startup_lpc54618.c:678 0x7ad6&amp;nbsp;&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;lt;signal handler called&amp;gt;() at 0xfffffff9&amp;nbsp;&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;SDIF_SendCommand() at fsl_sdif.c:729 0x56fe&amp;nbsp;&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;SDIF_TransferNonBlocking() at fsl_sdif.c:1,303 0x5c46&amp;nbsp;&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;SDMMCHOST_TransferFunction() at fsl_sdmmc_host.c:137 0x2b1c&amp;nbsp;&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;SD_StopTransmission() at fsl_sd.c:374 0xa86&amp;nbsp;&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;SD_Transfer() at fsl_sd.c:421 0xaf2&amp;nbsp;&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;SD_Write() at fsl_sd.c:1,460 0x203e&amp;nbsp;&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;SD_WriteBlocks() at fsl_sd.c:1,654 0x22b4&amp;nbsp;&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;sd_disk_write() at fsl_sd_disk.c:45 0x44ca&amp;nbsp;&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;disk_write() at diskio.c:223 0x7f4c&amp;nbsp;&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;f_write() at ff.c:3,875 0x94d6&amp;nbsp;&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;main() at fatfs_sdcard.c:275 0x688&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;arm-none-eabi-gdb (8.2.50.20181213) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2019 16:28:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027381#M2183</guid>
      <dc:creator>tomasvavra</dc:creator>
      <dc:date>2019-11-22T16:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: SDIF driver invalid error handling</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027382#M2184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for my late reply. I ran several times the fatfs_sdcard on my LPCXpresso54618 board and I couldn’t get&amp;nbsp; run into the assert in SDIF_TransferHandleData.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please provide the steps you are doing on your side to see if I can replicate the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2019 17:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027382#M2184</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-11-28T17:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: SDIF driver invalid error handling</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027383#M2185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN class=""&gt;Felipe, thank you for the reply. I can reproduce this by removing the SD card&lt;/SPAN&gt; during the write to the file. This causes a timeout and SD_StopTransmission() being issued, which sets handle-&amp;gt;data to null and following interrupt is trying to handle the data write SDIF_TransferHandleData() which expects handle-&amp;gt;data not being null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those 2 stacked calls are simply in collision.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2019 11:12:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027383#M2185</guid>
      <dc:creator>tomasvavra</dc:creator>
      <dc:date>2019-12-02T11:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: SDIF driver invalid error handling</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027384#M2186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for my delayed reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I debugged the code on my side and this is a correct behavior. If there is an error in the transmission SD_StopTransmission will abort the current transfer. What you could do is to change the reply argument when you call SD_Transfer. This way if the transmission fails, the software can retry several times to see if the connection can be established again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 23:40:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/SDIF-driver-invalid-error-handling/m-p/1027384#M2186</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-12-09T23:40:25Z</dc:date>
    </item>
  </channel>
</rss>

