<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58866/sdk-15-0-spim-example-issue-on-nrf52840</link><description>Hey all, 
 I am trying to run the &amp;quot;nrfx_spim&amp;quot; example on my nRF52840 USB Dongle (Makerdiary nRF52840 USB dongle), however it is not working. It looks like the code is never reaching the interrupt handler &amp;quot;spim_event_handler()&amp;quot;. The example code is using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Mar 2020 05:22:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58866/sdk-15-0-spim-example-issue-on-nrf52840" /><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/239432?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2020 05:22:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84afe419-ff76-4b7b-9086-c551c4f79c88</guid><dc:creator>aeozyalcin</dc:creator><description>&lt;p&gt;I have actually since moved from SPIM #3 that is the default on the examples to SPIM #0. I disabled SPIM#3 and the extended options in the makefile, and enabled SPIM#0. However, still having the same issues. With SPIM#0, I am using the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;APP_ERROR_CHECK(nrfx_spim_xfer(&amp;amp;spi, &amp;amp;xfer_desc, 0));&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/239425?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2020 02:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1e576bb-87c7-48ce-a26e-ee235eb9880f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Ah, I think you have DCX set (if &lt;em&gt;NRFX_SPIM_DCX_PIN&lt;/em&gt; is defined as a pin and &lt;em&gt;NRFX_SPIM_EXTENDED_ENABLED&lt;/em&gt;) but are using the non-DCX transfer function which never sets the expected length. If so maybe try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; APP_ERROR_CHECK(nrfx_spim_xfer_dcx(&amp;amp;spi, &amp;amp;xfer_desc, 0, 15)); // 15 is the example&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/239423?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2020 00:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc6181cb-a4ea-47a4-850d-aebf77a75770</guid><dc:creator>aeozyalcin</dc:creator><description>&lt;p&gt;Thanks for replying. I agree with what you are saying, and I am aware of this nuance. However unfortunately, the problem somehow lies within how the interrupts are handled in my case, and the event handler not being called. This information might help others though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/239422?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2020 00:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7705402b-acab-42e0-aed3-e11fccac7027</guid><dc:creator>aeozyalcin</dc:creator><description>&lt;p&gt;Thanks for the reply Simon. I have some updates:&lt;/p&gt;
&lt;p&gt;When I don&amp;#39;t pass a function for the SPI event handler, such that I initialize SPIM like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;APP_ERROR_CHECK(nrfx_spim_init(&amp;amp;spi, &amp;amp;spi_config, NULL, NULL));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Without interrupts, I am able to get SPIM to work. Looks like the issue lies somewhere within how the interrupts are handled. I have looked through the SDK documents, but can&amp;#39;t figure out what I might be doing wrong. Any idea why event handler interrupts&amp;nbsp;are not being handled? I am pretty sure that when I have the event handler passed into the SPIM init function, the function itself never gets called, and the SPI transaction stalls after the data bits are sent out without SS getting de-asserted. Thanks!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/238887?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 15:15:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:479d165c-6f58-439c-b6ef-746ceb1b1397</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This seems to be a common mistake when using SPI, covered quite a few times here on the devzone so maybe worth looking through some of those posts. In brief the received data is actually the 2nd byte, not the 1st byte. Change this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (m_rx_buf[0] != 0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (m_rx_buf[1] != 0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;mrxbuf must of course be at least 2 bytes long, and the requested received data length must be at least 2 bytes; 1 byte will not work as the SPI slave doesn&amp;#39;t know what data to send until it has received and decoded the first transmitted byte.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.0 SPIM Example Issue on nRF52840</title><link>https://devzone.nordicsemi.com/thread/238847?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 13:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0054e89e-5615-485c-a177-0696e1fafaf8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you adapted the example to run on the Dongle? Please check out the &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial"&gt;Dongle Programming tutorial&lt;/a&gt; and the&amp;nbsp;&lt;strong&gt;Adapt a simple example (&lt;em&gt;without SoftDevice)&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;section&amp;nbsp;to see how to adapt your project to fit the Dongle.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>