<?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のトピックRe: Problem running SPI driver on Vybrid</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288643#M9216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your advice. I'm running MQX 4.0.2 Beta1, which should (according to the release notes) support SPI. I stepped through the code and didn't see a reference to _&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;bsp_enable_card. Stepping into _io_spi_install, I hit an error at the line below, right after the program initializes the low level driver:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;error_code = driver_data-&amp;gt;DEVIF-&amp;gt;INIT(init_data_ptr-&amp;gt;DEVIF_INIT, &amp;amp;(driver_data-&amp;gt;DEVIF_DATA));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The error code returned is SPI_ERROR_CHANNEL_INVALID (0xA705).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jul 2013 17:32:20 GMT</pubDate>
    <dc:creator>n00b1024</dc:creator>
    <dc:date>2013-07-29T17:32:20Z</dc:date>
    <item>
      <title>Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288637#M9210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I'm having some trouble running the SPI demo in MQX 4.0 (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Freescale_MQX_4_0\mqx\examples\spi\iar\spi_vybrid_autoevb_a5&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;) on the Vybrid.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; spifd = fopen (TEST_CHANNEL, NULL) isn't succeeding in opening the spi driver and is returning null. TEST_CHANNEL = &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;"spi0:". Thoughts?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 23:08:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288637#M9210</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2013-07-23T23:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288638#M9211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure the "spi0:" device is installed. Startup code _bsp_enable_card() includes code that installs this IO device only if BSPCFG_ENABLE_SPI0 is defined as 1, (user_config.h.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 06:24:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288638#M9211</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-07-24T06:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288639#M9212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I set &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;BSPCFG_ENABLE_SPI0&lt;/SPAN&gt; = 1, but fopen still isn't succeeding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:07:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288639#M9212</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2013-07-24T22:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288640#M9213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, but why ? Do you try to step in into the fopen() function with the debugger to see, which code line causes this ? Can you show call stack ? Did you recompile the BSP and PSP projects, then the application ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 04:51:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288640#M9213</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-07-25T04:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288641#M9214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried rebuilding the bsp and psp libraries, and then the SPI applications, but no joy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's some code inside io_fopen. dev_ptr is set to (pointer)&amp;amp;kernel_data-&amp;gt;IO_DEVICES.NEXT, and then presumably IO_DEVICES.NEXT is supposed to change when _lwsem_post((LWSEM_STRUCT_PTR)&amp;amp;kernel_data-&amp;gt;IO_LWSEM) is called, but it doesn't, so io_fopen returns null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _lwsem_wait((LWSEM_STRUCT_PTR)&amp;amp;kernel_data-&amp;gt;IO_LWSEM);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dev_ptr = (IO_DEVICE_STRUCT_PTR)((pointer)kernel_data-&amp;gt;IO_DEVICES.NEXT);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while (dev_ptr != (pointer)&amp;amp;kernel_data-&amp;gt;IO_DEVICES.NEXT) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dev_name_ptr = dev_ptr-&amp;gt;IDENTIFIER;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp_ptr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = (char _PTR_)open_type_ptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (*tmp_ptr &amp;amp;&amp;amp; *dev_name_ptr &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (*tmp_ptr == *dev_name_ptr))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++tmp_ptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ++dev_name_ptr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endwhile */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (*dev_name_ptr == '\0') {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Match */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dev_ptr = (IO_DEVICE_STRUCT_PTR)((pointer)dev_ptr-&amp;gt;QUEUE_ELEMENT.NEXT);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; } /* Endwhile */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _lwsem_post((LWSEM_STRUCT_PTR)&amp;amp;kernel_data-&amp;gt;IO_LWSEM);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (dev_ptr == (pointer)&amp;amp;kernel_data-&amp;gt;IO_DEVICES.NEXT) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; } /* Endif */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside lwsem, there's some code that would change IO_DEVICES.NEXT, but the if statement isn't true, so that code there doesn't execute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((sem_ptr-&amp;gt;VALUE &amp;gt;= 0) &amp;amp;&amp;amp; (_QUEUE_GET_SIZE(&amp;amp;sem_ptr-&amp;gt;TD_QUEUE)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _QUEUE_DEQUEUE(&amp;amp;sem_ptr-&amp;gt;TD_QUEUE, td_ptr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _BACKUP_POINTER(td_ptr, TD_STRUCT, AUX_QUEUE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _TIME_DEQUEUE(td_ptr, kernel_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; td_ptr-&amp;gt;INFO = 0; /* Signal that post is activating the task */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _TASK_READY(td_ptr, kernel_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _CHECK_RUN_SCHEDULER(); /* Let higher priority task run */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 01:10:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288641#M9214</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2013-07-27T01:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288642#M9215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;then it seems "spi0:" device is not installed. try to to debug _bsp_enable_card(). step into _io_spi_install("spi0:", &amp;amp;_bsp_spi0_init); is this working ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also you say you debug &lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;spi_vybrid_autoevb_a5&lt;/SPAN&gt; ? this BSP will be supported by MQX 4.0.2 which has not been released yet. you can wait for MQX 4.0.2 release in August.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 08:54:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288642#M9215</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-07-29T08:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288643#M9216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your advice. I'm running MQX 4.0.2 Beta1, which should (according to the release notes) support SPI. I stepped through the code and didn't see a reference to _&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;bsp_enable_card. Stepping into _io_spi_install, I hit an error at the line below, right after the program initializes the low level driver:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;error_code = driver_data-&amp;gt;DEVIF-&amp;gt;INIT(init_data_ptr-&amp;gt;DEVIF_INIT, &amp;amp;(driver_data-&amp;gt;DEVIF_DATA));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The error code returned is SPI_ERROR_CHANNEL_INVALID (0xA705).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 17:32:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288643#M9216</guid>
      <dc:creator>n00b1024</dc:creator>
      <dc:date>2013-07-29T17:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running SPI driver on Vybrid</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288644#M9217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SPI is supported, but Vybrid AutoEVB BSP is not fully supported in the 4.0.2 Beta1 version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple code lines in the spi low lever driver that can return SPI_ERROR_CHANNEL_INVALID. Which one do you hit ? Why don't you debug down to the lowest level until you see the return SPI_ERROR_CHANNEL_INVALID statement ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By looking into the code I can see IO_ERROR returned by _bsp_dspi_io_init() in &lt;/P&gt;&lt;P&gt;\mqx\source\bsp\vybrid_autoevb_a5\init_gpio.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compare to the same function in:&lt;/P&gt;&lt;P&gt;\mqx\source\bsp\twrvf65gs10_a5\init_gpio.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will see that you need to implement the pin routing in the _bsp_dspi_io_init() on your own. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 05:28:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-running-SPI-driver-on-Vybrid/m-p/288644#M9217</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-07-30T05:28:59Z</dc:date>
    </item>
  </channel>
</rss>

