<?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>SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40283/sdk15-2-spi-transfer-stops-after-16bits-no-more-clocks</link><description>I have recently migrated from SDK 15.0 to 15.2 and are experiencing problems with my code. 
 I have a nRF52840DK and have attached two accelerometers to this board. I am able to talk to the accelerometers, and initialize them. This is done by short 2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Nov 2018 09:40:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40283/sdk15-2-spi-transfer-stops-after-16bits-no-more-clocks" /><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156618?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 09:40:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47ed04b9-a1e1-4a86-9735-de86cb3a9037</guid><dc:creator>Geir Strand</dc:creator><description>&lt;p&gt;Ok.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Removing the SPI transactions from the app_timer event handler fixed the issue. So my initial thoughts about SDK error was wrong - problem between keyboard and chair.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156596?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 08:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86d0815a-7412-49de-8fed-0bc9a1f25919</guid><dc:creator>Geir Strand</dc:creator><description>&lt;p&gt;I know, but even taking away static const from the array definition may result in arrays being put in flash as the compiler finds out that they are not modified...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156582?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 06:53:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deb011e1-84a7-4f89-a1ca-62fe9fb211fb</guid><dc:creator>Geir Strand</dc:creator><description>&lt;p&gt;I think your comment about interrupts may have gotten me thinking: the code I execute is run inside a app_timer event, and if I remember correctly, the SWI0 interrupt is set to interrupt priority 6. So isn&amp;#39;t it true that the interrupt from SPI will never happen as it is on the same priority? And that may be the reason why the SPI never transmitted more than 16 bits (without DMA)? I am rewriting the code to use SPIM, but I was wondering what best practice is regarding timers and peripherals.&lt;/p&gt;
&lt;p&gt;I need to sample the accelerometer every N millisecond and then do something with those data. Should the sampling of accelerometer happen in the main loop, using a flag to signal that I need to sample the accelerometer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156543?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 19:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fe9152c-ff5f-47a4-8bae-08329d9114da</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Most C compilers will put static const arrays[] into flash - this is expected on ARM architecture.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156537?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 17:34:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76f35df7-0459-4fdc-b0ae-3a33cc19cde6</guid><dc:creator>Geir Strand</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY is not defined in nrfx_config.h as it only links in sdk_config.h.&lt;/p&gt;
&lt;p&gt;The NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY was (and still is) set to 6 in sdk_config.h.&lt;/p&gt;
&lt;p&gt;Going through the code in more detail, I realized that I was using the old SPI driver and not SPIM. I am still having difficulties understanding which settings makes the driver switch from one to the other, but if I have debugged correctly, I need to set SPI0_ENABLED (or 1 or 2) _and_ SPI0_USE_EASY_DMA. Is this corect? Alll other settings related to SPI in sdk_config.h does not seem to influence which driver to use.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My first try with SPIM crashed at run-time as my transmit &amp;quot;buffer&amp;quot; were defined static const and the SPIM requires the tx_buffer to be in RAM. I wonder if the SPIM version of the driver should copy the transmit buffer as it is increasingly difficult to force compilers to keep static parts in RAM...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 SPI transfer stops after 16bits (no more clocks)</title><link>https://devzone.nordicsemi.com/thread/156519?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2018 15:02:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d556df39-0e77-4f4a-a8a4-6b9f9526f7f6</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Geir,&lt;/p&gt;
&lt;p&gt;From the SDK 15.2 release notes:&lt;br /&gt;&amp;quot;Changed the default interrupt priority level for the peripherals from 7 to 6. This is done to be aligned with the priority of the SWI coming from the SoftDevice.&amp;quot;&lt;br /&gt;&lt;br /&gt;I think you need to change&amp;nbsp;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY from 7 to 6 in nrfx_config.h as well as&amp;nbsp; NRF_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY in sdk_config.h&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>