<?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>Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28750/sending-to-spi-master-from-nrf52832-spi-slave</link><description>I have a BMD-300 Eval board with the nRF52832 programmed as SPI slave using the SPIS example program. It works, but I cannot figure out how to send a message back to the master. I am using an Atmel uC as the master.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Feb 2021 08:39:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28750/sending-to-spi-master-from-nrf52832-spi-slave" /><item><title>RE: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/292394?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 08:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2351852-1fb3-4af0-aa8b-dd7e163d154f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jesper&lt;/p&gt;
&lt;p&gt;I am happy to hear you found the issue &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&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: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/292223?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 12:56:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c913a2ac-02be-40d7-8aee-027d1b177d14</guid><dc:creator>J.Ulriksen</dc:creator><description>&lt;p&gt;.. I found the problem, ID10T Error, :-D , data gets through as it was supposed, the error resides in the debug print out string/call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/292191?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 11:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:006b3ce5-880d-4f27-8dab-b76f77898232</guid><dc:creator>J.Ulriksen</dc:creator><description>&lt;p&gt;As long as the nrf52 spi slave device is actin as a normal SPI slave device its OK.&lt;/p&gt;
&lt;p&gt;My SPI handler looks like this :&lt;/p&gt;
&lt;p&gt;void spis_event_handler(nrf_drv_spis_event_t event)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp;if (event.evt_type == NRF_DRV_SPIS_XFER_DONE)&lt;br /&gt;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; spi_cmd = m_rx_buf[0]; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //NRF_LOG_INFO(&amp;quot;0x%x&amp;quot;, spi_cmd);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; switch(spi_cmd) &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{ &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;case SPI_BLE_GET_STATUS:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_LOG_INFO(&amp;quot;CMD: Get status&amp;quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ble_status = 0x39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_tx_buf[0] = ble_status;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m_tx_buf[1] = ble_status;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_LOG_INFO(&amp;quot;An error occured in SPI command.&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; memset(m_rx_buf, NULL, sizeof(m_rx_buf));&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; APP_ERROR_CHECK(nrf_drv_spis_buffers_set(&amp;amp;spis, m_tx_buf, sizeof(m_tx_buf), m_rx_buf, sizeof(m_rx_buf)));&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //spis_xfer_done = false;&lt;br /&gt;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Receiving data/cmd from SPI master is working as expected, but sending back data (reply) to master, thats where I have a struggle.&amp;nbsp; ( I try to load 0x39 to the first 2 bytes of m_tx_buf , just to have something to send ) , but it is unclear how the SPI slave is actually send the data. Do I need to set a trigger or something or call a function ? ( I call the&amp;nbsp;&lt;span&gt;nrf_drv_spis_buffers_set at the end of SPI handler is that enough ? )&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rgds,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jesper&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/292114?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 06:19:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e1fce78-6a5c-498d-8143-1bea3d26b2c1</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jesper&lt;/p&gt;
&lt;p&gt;There is nothing the SPI slave can do but wait for the SPI master to start a transaction. As such all you can do on the code side is to prepare the next payload, and wait for the SPI master to initiate communication.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once this happens the incoming and outgoing data will be automatically written to/read from RAM by the EasyDMA controller.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Some SPI devices have an interrupt line that allows the SPI slave device to notify the SPI master device that it has some pending data, and would like the SPI master to start a transaction, but this not a part of the SPI standard and can be different from device to device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are controlling both the SPI master and slave device you can obviously set up a dedicated interrupt pin, and use it to initiate communication from the slave side.&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: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/292013?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 14:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80eedfe4-1fde-40a6-a783-12e03b03913b</guid><dc:creator>J.Ulriksen</dc:creator><description>&lt;p&gt;Hi Torbj&amp;oslash;rn,&lt;/p&gt;
&lt;p&gt;I have the same setup as described in the initial message...&lt;/p&gt;
&lt;p&gt;Can you explaine how the data is send out ??&amp;nbsp; ... I can load a wanted value to the TX buffer and call the function you are mentioning in your reply. But will the data be send out automatically ?&amp;nbsp; or do I still have have to clock back the message to the MCU ??&lt;/p&gt;
&lt;p&gt;As EasyDMA is used it may the first option , right ?&amp;nbsp; .. or is this just used for RX data ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending to SPI Master from nRF52832 SPI Slave</title><link>https://devzone.nordicsemi.com/thread/113927?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2017 11:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:068cb2f5-dfa4-4d4f-a4d6-c6d3f8535025</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;In the SPI example there should be a line like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_ERROR_CHECK(nrf_drv_spis_buffers_set(&amp;amp;spis, m_tx_buf, m_length, m_rx_buf, m_length)); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This call sets up the buffers that will be used for the next transaction. Whatever data you put into the m_tx_buf buffer will be output on the MISO line, and sent to the SPI master. The m_rx_buf buffer will be used to store incoming data from the master.&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>