<?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 Software Development Kitのトピックdisk_initialize(SD) hangs when using MQX</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/disk-initialize-SD-hangs-when-using-MQX/m-p/532282#M5524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a project which reads data from an SD card. It was written using bare metal and works fine. I would now like to transition the project to use MQX.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once I add "FSL_RTOS_MQX" to my defines, the disk_initialize(SD) function hangs.&lt;/P&gt;&lt;P&gt;I have not changed anything besides adding that define and including the MQX files in the SDK needed to compile the project.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the debugger and traced the hanging to the OSA_SemaWait call in fsl_sdhc_driver.c, which I have determined is implemented slightly differently for MQX than it is for bare metal. I, however, cannot determine why the function is hanging.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody point me in the right direction to fix this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Aug 2016 21:18:39 GMT</pubDate>
    <dc:creator>barrymcnamara</dc:creator>
    <dc:date>2016-08-16T21:18:39Z</dc:date>
    <item>
      <title>disk_initialize(SD) hangs when using MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/disk-initialize-SD-hangs-when-using-MQX/m-p/532282#M5524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a project which reads data from an SD card. It was written using bare metal and works fine. I would now like to transition the project to use MQX.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once I add "FSL_RTOS_MQX" to my defines, the disk_initialize(SD) function hangs.&lt;/P&gt;&lt;P&gt;I have not changed anything besides adding that define and including the MQX files in the SDK needed to compile the project.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the debugger and traced the hanging to the OSA_SemaWait call in fsl_sdhc_driver.c, which I have determined is implemented slightly differently for MQX than it is for bare metal. I, however, cannot determine why the function is hanging.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody point me in the right direction to fix this?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 21:18:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/disk-initialize-SD-hangs-when-using-MQX/m-p/532282#M5524</guid>
      <dc:creator>barrymcnamara</dc:creator>
      <dc:date>2016-08-16T21:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: disk_initialize(SD) hangs when using MQX</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/disk-initialize-SD-hangs-when-using-MQX/m-p/532283#M5525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I eventually got past the disk_initialize(SD) call by adding the following line at the start of my main task:&lt;/P&gt;&lt;P&gt;OSA_InstallIntHandler(SDHC_IRQn, MQX_SDHC_IRQHandler);&lt;/P&gt;&lt;P&gt;I had to import fsl_sdhc_irq.c for this to work, which isn't ideal since you generally shouldn't import .c files, but this was the only file in the SDK that had the right IRQ handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I then encountered another problem. I set the current drive with f_chdrive(SD) and call f_mount(SD), but the current drive would not remain set when I called f_opendir, returning the FR_NOT_ENABLED status. I managed to fix this by changing ff.h so that CurrVol is initialized to 1 (SD) instead of 0 (USB) which is also an ugly hack, but this was the only thing that seemed to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody has a more elegant solution, I would love to hear it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 20:37:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/disk-initialize-SD-hangs-when-using-MQX/m-p/532283#M5525</guid>
      <dc:creator>barrymcnamara</dc:creator>
      <dc:date>2016-08-19T20:37:24Z</dc:date>
    </item>
  </channel>
</rss>

