<?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>SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840</link><description>Hi, 
 
 I am using nRF52840 on custom board. I am trying to configure SPI pins, but I am not getting anything on the clock pin. I can see the chip select pin going low and high which is good. But there is no clock on the pin. Following is the code snippet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Jul 2021 16:56:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840" /><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/321430?ContentTypeID=1</link><pubDate>Thu, 22 Jul 2021 16:56:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f1bf87d-9e0f-4bac-ae80-6eae1280a35a</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;So, finally I was able to see the clock and signal. The Problem was disabling the interrupts before calling the transfer function and this discussion helped me to configure SPI driver properly. Thanks to Hmolesworth and Einar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317440?ContentTypeID=1</link><pubDate>Mon, 28 Jun 2021 10:57:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf751de7-0ba2-4610-9dc0-97dadbe02742</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Shivek,&lt;/p&gt;
[quote userid="98444" url="~/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840/317304#317304"]I already have tried that example. The screenshots I have attached are from the same example. So, that&amp;#39;s why I asked if you can provide me the example which is not included in the SDK examples.[/quote]
&lt;p&gt;I see. I am not able to make any simpler example than that one, as it is minimal,&amp;nbsp;so I think we need to look more at what you do instead, then. Perhaps you can show a complete project that reproduce this so that we see exactly what you do, as well as schematics for your custom board.&lt;/p&gt;
[quote userid="98444" url="~/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840/317298#317298"]&lt;p&gt;So, if we want to use simple SPI peripheral (not using EasyDMA) with SPI0 instance, we need to set &lt;strong&gt;&lt;em&gt;SPI0_ENABLED&lt;/em&gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&lt;em&gt;SPI_ENABLED&lt;/em&gt;&lt;/strong&gt; to 1 and we need to disable SPIM peripheral by setting &lt;em&gt;&lt;strong&gt;NRFX_SPIM0_ENABLED&lt;/strong&gt;&lt;/em&gt;, &lt;strong&gt;&lt;em&gt;NRFX_SPIM_ENABLED&lt;/em&gt;&lt;/strong&gt; to 0.&lt;/p&gt;
&lt;p&gt;Firstly, I found in the spi_master_using_nrf_spi_mngr that NRFX_SPIM_ENABLED is set to 1. May I ask why is that so?&lt;/p&gt;[/quote]
&lt;p&gt;Unfortunately the driver configuration is a bit complex for legacy reasons. Generally, as you use the nrf_drv driver API (legacy API), the configuration macros starting with NRFX_ are irrelevant. What happens is that the macros starting with SPI* take precedence. and when it comes to using SPI or SPIM peripheral, that is decided by the value of&amp;nbsp;SPI0_USE_EASY_DMA for instance 0, SPI1_USE_EASY_DMA for instance 1, etc.&lt;/p&gt;
&lt;p&gt;(Note that the API is the same in both cases, and you typically want to use the SPIM peripheral as it uses DMA. The driver handles all the differences for you, but that is much more sensible in a real application as the CPU can do other work while the SPIM peripheral handles the transaction.)&lt;/p&gt;
[quote userid="98444" url="~/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840/317298#317298"]Secondly, when I debug the same example on nrf52840, I can see the registers for both SPIM0 and SPI0 being configured with the same pins. Which can be a problem as described in the nrf52840 Product specifications. The document clearly says that only one peripheral can be associated to a particular pin at one point of time.&amp;nbsp;[/quote]
&lt;p&gt;I see &lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt; explained this good. All peripherals with the same register base address share the same physical components, and cannot be used at the same time. It does not make sense to look at the register of the other with the same address etc.&lt;/p&gt;
[quote userid="98444" url="~/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840/317298#317298"]I will appreciate if you can provide full settings for sdk_config.h or anything else, to use SPI0/SPIM0 with and without EasyDMA as I am not able to find any documentation on that.&amp;nbsp;[/quote]
&lt;p&gt;Just refer to the mentioned example and change the value of&amp;nbsp;SPI0_USE_EASY_DMA. that is the only required change.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317305?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 16:05:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ae66bb-f753-4317-bf44-d2e4629d9651</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi hmolesworth,&lt;/p&gt;
&lt;p&gt;Thanks for the clarification. I saw that happening with the bit0 of ENABLE register when only SPI0 is enabled and bits1 and bits2 set to 0 when I disabled the EasyDMA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can see pin toggling at serial clock pin but once only. Like it will go from high to low and then low to high but no serial clock. Will try to use SPIM0 instead of SPI0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317304?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 15:59:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9211bba-3d58-4541-83c6-8d5155c6f365</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I already have tried that example. The screenshots I have attached are from the same example. So, that&amp;#39;s why I asked if you can provide me the example which is not included in the SDK examples.&lt;/p&gt;
&lt;p&gt;Looking forward for your response to other questions as well.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317302?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 15:55:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52811226-4a4b-43fd-9708-7ca52f133b9a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;To clarify the peripherals, SPI0 and SPIM0 and TWI0 are all the same physical hardware peripheral, so only one can be used at any given time; to distinguish between SPI0 and SPIM0 the &lt;em&gt;Enable&lt;/em&gt; bits are different - bit 0 enables the SPI peripheral and bits 1 and 2 additionally enable the Tx and Rx DMA (SPIM peripheral). Usually the &lt;em&gt;only&lt;/em&gt; reason to not use DMA (SPIM) is to avoid the increased power drain caused by DMA.&lt;/p&gt;
&lt;p&gt;Einar will be better able to describe the SDK settings; I prefer bare-metal which avoids those.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317298?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 15:36:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c8acb4c-62bd-4849-878b-bc87cc919168</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I found something not good with the SPI peripheral registers. According to my understanding, SPI driver from Nordic is associated with SPI peripheral interface master (&lt;strong&gt;page no. 398 of&lt;/strong&gt; &lt;strong&gt;nrf52840 PS v 1.2&lt;/strong&gt;) and SPIM driver is associated with SPIM with EasyDMA (&lt;strong&gt;page no. 406 of&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;nrf52840 PS v 1.2&lt;/strong&gt;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, if we want to use simple SPI peripheral (not using EasyDMA) with SPI0 instance, we need to set &lt;strong&gt;&lt;em&gt;SPI0_ENABLED&lt;/em&gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&lt;em&gt;SPI_ENABLED&lt;/em&gt;&lt;/strong&gt; to 1 and we need to disable SPIM peripheral by setting &lt;em&gt;&lt;strong&gt;NRFX_SPIM0_ENABLED&lt;/strong&gt;&lt;/em&gt;, &lt;strong&gt;&lt;em&gt;NRFX_SPIM_ENABLED&lt;/em&gt;&lt;/strong&gt; to 0.&lt;/p&gt;
&lt;p&gt;Firstly, I found in the spi_master_using_nrf_spi_mngr that NRFX_SPIM_ENABLED is set to 1. May I ask why is that so?&lt;/p&gt;
&lt;p&gt;Secondly, when I debug the same example on nrf52840, I can see the registers for both SPIM0 and SPI0 being configured with the same pins. Which can be a problem as described in the nrf52840 Product specifications. The document clearly says that only one peripheral can be associated to a particular pin at one point of time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Following is the snapshot from debug mode when I try with the above mentioned example:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="301" src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/7776.Capture12.PNG" width="217" /&gt;&lt;img alt=" " height="166" src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/Capture13.PNG" width="226" /&gt;&lt;/p&gt;
&lt;p&gt;I tried writing directly to the ENABLE register of SPIM0 so to disable it. It didn&amp;#39;t make a difference. Here is the configuration function code for SPI0 instance initialization.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        //GPIO configuration
        nrf_gpio_cfg_output(MEM_CS);
        nrf_gpio_cfg_output(MEM_SI);
        nrf_gpio_cfg_output(MEM_SCK);
        nrf_gpio_cfg_input(MEM_SO, GPIO_PIN_CNF_PULL_Pulldown);
        
        //SPI configuration
        nrf_drv_spi_config_t spi_config;// = NRF_DRV_SPI_DEFAULT_CONFIG;
        
        spi_config.ss_pin    = MEM_CS;
        spi_config.miso_pin  = MEM_SO;
        spi_config.mosi_pin  = MEM_SI;
        spi_config.sck_pin   = MEM_SCK;
        spi_config.bit_order = NRF_SPI_BIT_ORDER_MSB_FIRST;
        spi_config.frequency = NRF_SPI_FREQ_250K;
        spi_config.mode      = NRF_SPI_MODE_2;
        
        //disabling the SPIM0.
        NRF_SPIM0-&amp;gt;ENABLE    = 0;
        
        nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, NULL, NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will appreciate if you can provide full settings for sdk_config.h or anything else, to use SPI0/SPIM0 with and without EasyDMA as I am not able to find any documentation on that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317286?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 15:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d63ab875-de63-477e-9b1b-3c7c46455176</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Shivek,&lt;/p&gt;
&lt;p&gt;I see you ask for an example which is not included in the SDK, but did you try the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/spi_master_example.html"&gt;SPI Master Example?&lt;/a&gt;&amp;nbsp;That is quite simple so if I was to make another example it would be basically the same. Have you tested that on your HW?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317285?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 15:09:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de64619d-dd43-4fa1-9ffc-a2c92447a53f</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&lt;span&gt;&lt;em&gt;I am not getting anything on the clock pin&lt;/em&gt; -- at 250kHz clock I would think even a cheap &amp;#39;scope would see that, but are you using (say) some low-cost analyser which might have too low a resolution?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;p_tx_buffer&lt;/em&gt;,and &lt;em&gt;sizeof(tx_buffer)&lt;/em&gt; are inconsistent (different buffers), maybe make the buffer size bigger so easier to see the clocks. Hopefully the buffer is not defined const ..&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317258?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 13:39:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bca6aba-aa35-4e93-9803-d259398e7227</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Einar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As I mentioned in my response to &lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;, I have tried using P0.13 as normal GPIO and tested toggling the pin, I was able to see the pin toggling on scope. But if I am using the same pin for SPI clock, it won&amp;#39;t get any clock going on that pin.&lt;/p&gt;
&lt;p&gt;Would you be able to send a simple example(other than which is included in SDK), which I can test on my hardware just by simply changing the pins?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I think that would make me clear that whether its a hardware issue or software issue.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317233?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 12:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ed4c2a1-f91c-4dfa-b231-bd5817d1eeec</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Hmolesworth,&lt;/p&gt;
&lt;p&gt;Thanks for your time to give it a look. I have tried using P0.13 from nRF52840 as normal GPIO, and I was able to control the state of the pin, i.e., toggle the pin after some time. So, that&amp;#39;s why I am sure about pin P0.13 and on top of that I tested with multimeter there is a connection from M2 connector pin(the pin which is connected to nRF52840 P0.13 pin on the LN60E840E module) to the connector header on the dev kit.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317203?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 10:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1bb7e43-6a82-4a53-8d4e-7339613432aa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Good points.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/shivek"&gt;Shivek&lt;/a&gt;:&amp;nbsp;Perhaps it is worth configuring the SCK and other pins as normal GPIOs that you toggle, and check with a logic analyzer to verify that the pin mapping is actually what you think it is?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317094?ContentTypeID=1</link><pubDate>Fri, 25 Jun 2021 01:26:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dc47bfb-b6df-4d3b-8f91-ad2dbb3f96f1</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Confusing schematic, but it looks like nRF52840 P0.13 is not available on a pin; P013 may instead be the P0.13 pin on the nRF9160.&amp;nbsp; Edit: oh, maybe it&amp;#39;s the other way round which means it is available. Hmm ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317088?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 21:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af5203b4-d156-4419-8791-8ba6802d871e</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/76682/spi-clock-pin-configuration-for-nrf52840/317016#317016"]So you should at least remove the call to&amp;nbsp;&lt;code&gt;__disable_irq()&lt;/code&gt;.[/quote]
&lt;p&gt;I tried removing the&amp;nbsp;line&amp;nbsp;&lt;span&gt;__disable_irq(). But it didn&amp;#39;t help. I am still not able to see the clock on the pin. I tried the code with the board supplied by Fanstel. I have attached the document from them which has the schematic for the dev kit I am using. I will really appreciate if you can have a look on the document and let me know if there is anything I am doing wrong with the pin selection for the purpose.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/M2_5F00_LN60E40F_2B00_Product_2B00_Specifications.pdf"&gt;devzone.nordicsemi.com/.../M2_5F00_LN60E40F_2B00_Product_2B00_Specifications.pdf&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The LN60E40F is a module based on nRF9160 and nRF52840. For the schematic you can go to the page no. 25 of this document.&amp;nbsp;The schematic is not having good resolution and that is frustrating for me as well.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your efforts.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Shivek&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317067?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 16:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e56f92e-059f-4437-a386-f273c7a77994</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using SPI peripheral. I have enabled DMA using SPI0_USEE_EASY_DMA define in sdk_config.h. Here is the snippet from sdk_config file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#ifndef SPI0_ENABLED
#define SPI0_ENABLED 1
#endif
// &amp;lt;q&amp;gt; SPI0_USE_EASY_DMA  - Use EasyDMA
 

#ifndef SPI0_USE_EASY_DMA
#define SPI0_USE_EASY_DMA 1
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for responding back. I will try what you have told me and let you know.&lt;/p&gt;
&lt;p&gt;Its good to know that we should not be accessing any pins if we have configured for any peripheral.&lt;/p&gt;
&lt;p&gt;I will get back soon after trying.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks once again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Shivek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/317016?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 13:19:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:486b34fb-8b40-4ace-bc5c-b2cdb6249f0a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using the SPI or SPIM peripheral? (do you enable DMA or not in sdk_config.h)?&lt;/p&gt;
&lt;p&gt;While that should not explain this issue, I notice that you control the CS signal yourself using&amp;nbsp;nrf_gpio_pin_clear() before the transaction and&amp;nbsp;nrf_gpio_pin_set() after (using just a delay which is more than long enough). In that case you should use&amp;nbsp;NRF_DRV_SPI_PIN_NOT_USED when you configure the driver. Alternatively, keep your driver configuration and remove the controlling of the CS pin in your&amp;nbsp;memId() function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the issue itself I dot not immediately see what casues the issue, but you disable interrupts during the transaction, and this will cause problems&amp;nbsp;for the driver which is interrupt driven. So you should at least remove the call to&amp;nbsp;&lt;code&gt;__disable_irq()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI clock pin configuration for nRF52840.</title><link>https://devzone.nordicsemi.com/thread/316809?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 16:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59878a11-dcce-4779-829f-7a20f3871d29</guid><dc:creator>Shivek</dc:creator><description>&lt;p&gt;I forgot to add the event handler code so to explain further, here is the code for event handler function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void spi_event_handler(nrf_drv_spi_evt_t const * p_event,
                       void *                    p_context)
{
    printf(&amp;quot;\r\n Error : %ld&amp;quot;, err);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Every time I am calling, memId I can see the chip select pin (MEM_CS) goes low and high. The delay in memId funciton is just for testing purpose. So, I can see the Error being printed as &amp;quot;0&amp;quot;, that means the nrf_drv_spi_transfer() returns successfully. This is confusing me.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looking forward for any help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>