<?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>nRF52 - SPIM - read buffer empty</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18891/nrf52---spim---read-buffer-empty</link><description>Hi, 
 I have a problem with my SPIM read buffer.
As you can see below, my SPI device received bytes correctly and answer correctly 
 
 My code is based on SPI example SDK 12.1. 
 SPI initialisation 
 void SPI_init(nrf_drv_spi_t* spi_inst, uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Jan 2017 15:26:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18891/nrf52---spim---read-buffer-empty" /><item><title>RE: nRF52 - SPIM - read buffer empty</title><link>https://devzone.nordicsemi.com/thread/73000?ContentTypeID=1</link><pubDate>Wed, 11 Jan 2017 15:26:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78ab4988-bc96-4444-bcbb-9a901a5cb4bb</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Don&amp;#39;t know if this is the root cause of your problem, but you should not pass tx_buffer or rx_buffer as NULL and the length as non-zero. You can see that the &lt;code&gt;nrf_drv_spi_xfer(..)&lt;/code&gt; function checks for this at the start of the function (the code will not assert unless &lt;code&gt;NRF_ASSERT_PRESENT&lt;/code&gt; is defined):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ASSERT(p_xfer_desc-&amp;gt;p_tx_buffer != NULL || p_xfer_desc-&amp;gt;tx_length == 0);
ASSERT(p_xfer_desc-&amp;gt;p_rx_buffer != NULL || p_xfer_desc-&amp;gt;rx_length == 0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(the assert will trigger if the input is zero).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>