<?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>understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56857/understanding-spi-with-easy-dma</link><description>Hi! 
 I want to understand different in use with DMA and w/o DMA in the SPI. 
 I explore example SPI from SDK examples and see that enabled SPI and SPIM together. 
 
 But at this case what 
 
 handled? 
 SPI works with DMA? If I don&amp;#39;t want to work with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jan 2020 13:48:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56857/understanding-spi-with-easy-dma" /><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/231171?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 13:48:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50ec9f1d-4bef-4d91-bd31-f2d09ae2d8ec</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Mikhail&lt;/p&gt;
&lt;p&gt;If you want SPI slave you should enable SPIS_ENABLED.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This define is not included in the SPI master example, but you can look at sdk_config.h in the SPI slave example to see how it can be implemented.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that there is no choice of DMA or not when using SPI slave, as the SPI slave peripheral&amp;nbsp;had DMA from the start.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230872?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 13:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fd7e067-2a37-4b60-bf40-6920672afa39</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Ok, therefore if I need DMA SPI I sould enable only&amp;nbsp;&lt;span&gt;SPI_ENABLED&amp;nbsp;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But if I want slave or master SPI?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I thought that for use slave or master I should use SPIM or SPIS&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div style="left:-24px;position:absolute;top:58px;" id="gtx-trans"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230859?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 12:58:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5477429-c06c-4240-9d67-13b0e6b6297d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry, it seems my screenshot was a bit confusing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is enough to only enable SPI_ENABLED, as shown here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5221b02f05c7418fb347d9ee1a5f334a/pastedimage1579870649128v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Enabling NRFX_SPI_ENABLED and NRFX_SPIM_ENABLED should not do any harm, but is not necessary. They will be enabled automatically as needed by the SPI_ENABLED settings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230849?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 12:43:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f087d1c-90e9-4fa5-87ce-fd79a1c738ff</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks. Therefore, for use SPI DMA should I enable NRFX_SPIM,&amp;nbsp;&lt;span&gt;NRFX_SPI and SPI_ENABLED with USE_EASY_DMA?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Means, should enable those 3 things? All together.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230824?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 11:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d402bd5a-476d-4cf7-bf5c-b17e592a894e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Mikhail&lt;/p&gt;
&lt;p&gt;The SPIM interface uses DMA, that is correct. The older SPI interface did not have DMA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason the peripheral configuration is a bit confusing is that the older nrf_drv_spi driver (accessed through SPI_ENABLED) was later on replaced by the nrfx drivers, and to avoid having to rewrite all the examples the nrf_drv_spi implementation was changed&amp;nbsp;to only forward the calls to the nrfx implementation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is possible to call the nrfx API directly, but in general it is easier to keep the nrf_drv_spi interface on top, and just use nrfx under the hood.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is no need to enable NRFX_SPIM_ENABLED or NRFX_SPI_ENABLED. As long as you enable SPI_ENABLED, and enable SPIx_USE_EASY_DMA for any instance that you use, the nrfx_spim driver will be enabled automatically, and DMA will be used:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-5221b02f05c7418fb347d9ee1a5f334a/pastedimage1579859678861v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230494?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2020 08:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a050a0d4-5be9-4b4a-bbff-f2ba600e3792</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Hi! Thanks.&lt;/p&gt;
&lt;p&gt;I understand that should use DMA in the nRF52.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But DMA means SPIM? Or means NRFX?&lt;/p&gt;
&lt;p&gt;Could you explane me in the above screenshot, in the your example SPI, for what needs three SPI declarations?&lt;/p&gt;
&lt;p&gt;- NRFX SPIM&lt;/p&gt;
&lt;p&gt;- NRFX SPI&lt;/p&gt;
&lt;p&gt;- SPI enabled&lt;/p&gt;
&lt;p&gt;If I only need to use SPI master with DMA, which settings in the sdk_config.h should I enable?&lt;/p&gt;
&lt;p&gt;Which instance should use in those settings for DMA use?&lt;/p&gt;
&lt;p&gt;Why in this example used instance from just SPI?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1579766964035v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And in a code I use this instance&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define SPI_INSTANCE  0 /**&amp;lt; SPI instance index. */
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);  /**&amp;lt; SPI instance. */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Therefore, for use DMA with SPI master, how should minimum configure&amp;nbsp;&lt;span&gt;sdk_config.h and wich instance should enable?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: understanding SPI with easy DMA</title><link>https://devzone.nordicsemi.com/thread/230488?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2020 07:49:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cd6f783-6b40-4130-8528-d19b865bcddf</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Mikhail&lt;/p&gt;
&lt;p&gt;There is no reason not to use DMA in the nRF52832.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason we support both is that the older nRF51 devices did not support DMA in the SPIM interface, and the driver was designed to support operation both with and without DMA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;All the nRF52 devices support DMA in the SPIM interface, and using DMA ensures less CPU utilization and lower current consumption, so I would recommend using it at all times.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>