<?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 slave buffers nrf52833</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79213/spi-slave-buffers-nrf52833</link><description>Hello, 
 I am a bit confused about the SPI api documentation: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/peripherals/spi.html#spi-api 
 The spi_transceive function accepts multiple tx and rx buffers. How are these used</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Sep 2021 14:34:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79213/spi-slave-buffers-nrf52833" /><item><title>RE: SPI slave buffers nrf52833</title><link>https://devzone.nordicsemi.com/thread/328004?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 14:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6117d4a-f584-45b4-8f94-60b6a2c6a7c1</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Martijn Jonkers"]The example, you mentioned is exactly what I mean. It uses a 2 single 2 byte buffers for both tx and rx. How does this work with multiple buffers? What is happening when multiple buffers are provided?[/quote]
&lt;p&gt;&amp;nbsp;It will assert. Using multiple buffers via the Zephyr API is not supported by nrfx. From transceive() which is called by spi_nrfx_transcieve_async() which again is called by&amp;nbsp;spi_transceive_async():&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1630679022206v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Martijn Jonkers"]Thank you. That thoughput of 1.3Mbps, is that also possible with the nrf connect sdk[/quote]
&lt;p&gt;&amp;nbsp;I&amp;#39;m not sure but my guess is that it&amp;#39;s comparable with the Softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Martijn Jonkers"]And the&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1gac924e4bc03624cf27cd384fc51bafcf9"&gt;&lt;span&gt;NRFX_SPIM_FLAG_TX_POSTINC&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1ga63c1dbb8a983afb0b6a04e3d6565138a"&gt;&lt;span&gt;NRFX_SPIM_FLAG_RX_POSTINC&lt;/span&gt;&lt;/a&gt;&amp;nbsp;flags, they are for the SPI master. are there slave equivalents?[/quote]
&lt;p&gt;&amp;nbsp;The nRFX driver for the SPIS does not have this option, but the peripheral and HAL supports it. Which means that it should be possible to implement this feature in the driver as what has been done for the SPIM. You would have to&amp;nbsp;create a function that implements it yourself by using the array list feature of the EasyDMA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave buffers nrf52833</title><link>https://devzone.nordicsemi.com/thread/327929?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 09:20:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b444267-f3df-40bc-9488-80b3644385d0</guid><dc:creator>Martijn Jonkers</dc:creator><description>&lt;p&gt;Do you also have an answer to this part?&lt;/p&gt;
[quote userid="107622" url="~/f/nordic-q-a/79213/spi-slave-buffers-nrf52833"]The &lt;span&gt;spi_transceive function accepts multiple tx and rx buffers. How are these used? I think my question is not specific for SPI slave or master, but just for context: I am trying to implement a SPI&amp;nbsp;&lt;/span&gt;slave. All the examples I found all use a 1 or 2 byte single tx and rx buffer. But the api accepts multiple buffers, and even a different amount of buffers for tx and rx, I don&amp;#39;t see how this is supposed to be used.[/quote]
&lt;p&gt;The example, you mentioned is exactly what I mean. It uses a 2 single 2 byte buffers for both tx and rx. How does this work with multiple buffers? What is happening when multiple buffers are provided?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave buffers nrf52833</title><link>https://devzone.nordicsemi.com/thread/327926?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 09:06:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d0ec721-9495-480f-9e70-092e21562e38</guid><dc:creator>Martijn Jonkers</dc:creator><description>&lt;p&gt;Thank you. That thoughput of 1.3Mbps, is that also possible with the nrf connect sdk? Or do I need the nRF5 sdk with softdevice? And the&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1gac924e4bc03624cf27cd384fc51bafcf9"&gt;&lt;span&gt;NRFX_SPIM_FLAG_TX_POSTINC&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1ga63c1dbb8a983afb0b6a04e3d6565138a"&gt;&lt;span&gt;NRFX_SPIM_FLAG_RX_POSTINC&lt;/span&gt;&lt;/a&gt;&amp;nbsp;flags, they are for the SPI master. are there slave equivalents?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave buffers nrf52833</title><link>https://devzone.nordicsemi.com/thread/327912?ContentTypeID=1</link><pubDate>Fri, 03 Sep 2021 08:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9791a7e-7633-4343-bb47-d72f31da9749</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]BLE with the nrf52 has a max throughput of about 1.4 Mbit, right?[/quote]
&lt;p&gt;&amp;nbsp;This depends on several factors both external such as environment but also the internal state of the IC such as what GATT role it implements and the connection interval etc. &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/ble_data_throughput/ble_data_throughput.html"&gt;See this&lt;/a&gt;.&lt;/p&gt;
[quote user=""]&lt;p&gt;Is it possible to configure 2 buffers in a ping pong configuration, for example? So, new data can still be received when part of it is being transferred over BLE?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes this is possible. The SPIM peripheral itself supports double buffering, which means that the TX and RX buffer can updated once the STARTED event has been generated. If you&amp;#39;re using the nrfx driver directly you can update the buffer by using the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1gac924e4bc03624cf27cd384fc51bafcf9"&gt;&lt;span&gt;NRFX_SPIM_FLAG_TX_POSTINC&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/spim/driver.html#group__nrfx__spim_1ga63c1dbb8a983afb0b6a04e3d6565138a"&gt;&lt;span&gt;NRFX_SPIM_FLAG_RX_POSTINC&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;flags when you call&amp;nbsp;nrfx_spim_xfer(), this will use the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/spim.html?cp=4_2_0_30_1_0#topic"&gt;array list functionality&lt;/a&gt; of the peripheral.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;AFAIK this requires you to use the nrfx driver directly as I don&amp;#39;t think the Zephyr API exposes this possibility.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://github.com/too1/ncs-spi-master-slave-example/blob/master/src/main.c"&gt;Here is an example&lt;/a&gt; that uses the Zephyr API and sets up an SPI Master and Slave on the same device. It should give you an overview on how to use the API.&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;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>