<?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 long data transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41636/spi-long-data-transfer</link><description>Hello Everyone, 
 
 I am newbie to nordic BLE environment. This maybe a silly question. 
 Currently I am using nrf51 DK with SDK11, S130. 
 Data to be sent through SPI: 
 
 I checked the example code in SDK11, and there is example code and m_tx_buf is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 14 Jan 2019 13:27:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41636/spi-long-data-transfer" /><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/165472?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 13:27:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e65a7823-f4a7-46be-a5ed-b7a3f4ae5727</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There have been a few weeks before this last update&amp;nbsp;so I am unsure about what to look for. Can you explain the current issue, and how the code snipped and data you have printed relates to it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/165403?ContentTypeID=1</link><pubDate>Mon, 14 Jan 2019 10:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be5da58b-3f2b-4fb3-ba83-e16d34877ce2</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;I am reading this Data:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;0&amp;gt; 790A000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000305705000000000000
0&amp;gt; 790A000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000305705000000000000
0&amp;gt; 790A000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000305705000000000000
0&amp;gt; 790A000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000305705000000000000
0&amp;gt; 790A000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000D0A8FA000000000000
0&amp;gt; 79AD000000000000000000000000
0&amp;gt; 7900000000305705000000000000&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;while(1)
    {

        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, m_length);
				spi_xfer_done = false;

				sendSPI(0xAD0055730);
				nrf_delay_ms(2000);
				sendSPI(0xADFFFAA8D0);     //XTARGET=512000 | 10 revolutions with micro step = 256

				sendSPI(0x2100000000);
				sendSPI(0xADFFFAA8D0);
				nrf_delay_ms(2000);	
				sendSPI(0x2100000000);
			
				while (!spi_xfer_done)
        {
            __WFE();
        }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162777?ContentTypeID=1</link><pubDate>Fri, 21 Dec 2018 07:10:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28b07486-b92f-478b-9427-868b7c2a1560</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screen-Shot-2018_2D00_12_2D00_21-at-12.39.14-PM.png" /&gt;&lt;/p&gt;
&lt;p&gt;Data is received only once I see on the datasheet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162710?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 15:40:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bf8e7c5-a5fc-4dc7-bf33-faf734f38933</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Your m_rx_buf buffer should hold the buffer the nRF receives from the SPI slave (on MISO). Which data is that? have you checked verified the actual data on the SPI lines (using for instance a logic analyzer)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162687?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 14:29:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:460a42a2-b404-477d-a0d8-01f47c43cd8d</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;However, its always printing &amp;ldquo;FFFFFFFF000000000000000000000000&amp;rdquo;&lt;/p&gt;
&lt;p&gt;i assume m_rx_buf should have printed the data which is written over SPI right?&lt;/p&gt;
&lt;p&gt;In code, i am trying to write:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;0x80000008&lt;/p&gt;
&lt;p&gt;0xEC0100C5&lt;/p&gt;
&lt;p&gt;and so on...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162672?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 13:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cdc91ad-6ee4-4c7e-98b2-70af7ca086e5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Perfect. Then that is the content of the&amp;nbsp;&lt;span&gt;m_rx_buf at the point where you print it. (Note that you could always beautify&amp;nbsp;it if you want by for instance splitting in bytes and prefixing each byte with 0x by changing the print statement to this: &amp;quot;NRF_LOG_PRINTF(&amp;quot;0x%02x, &amp;quot;, m_rx_buf[i]);&amp;quot;).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162666?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 13:37:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b0f3aef-4bb0-4d6c-849c-2eb7907428b7</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;For this:&lt;/p&gt;
&lt;p&gt;for (int i = 0; i &amp;lt; sizeof(m_rx_buf); i++)&lt;br /&gt;{&lt;br /&gt; NRF_LOG_PRINTF(&amp;quot;%02x&amp;quot;, m_rx_buf[i]);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Output is : FFFFFFFF00000000000000000000&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;complete code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 */

#include &amp;quot;nrf_drv_spi.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;lt;string.h&amp;gt;

#if defined(BOARD_PCA10036) || defined(BOARD_PCA10040)
#define SPI_CS_PIN   29 /**&amp;lt; SPI CS Pin.*/
#elif defined(BOARD_PCA10028)
#define SPI_CS_PIN   2  /**&amp;lt; SPI CS Pin.*/
#define SPI_SCK_PIN 4
#define SPI_MOSI_PIN 1
#define SPI_MISO_PIN 3


#else
#error &amp;quot;Example is not supported on that board.&amp;quot;
#endif

#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. */
static volatile bool spi_xfer_done;  /**&amp;lt; Flag used to indicate that SPI instance completed the transfer. */
long long MISO = 0x8000000008;
#define TEST_STRING &amp;quot;0x8000000008&amp;quot;

unsigned char val0, val1, val2, val3, val4;

static uint8_t       m_tx_buf[] = {0x80};           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[sizeof(TEST_STRING)+1];    /**&amp;lt; RX buffer. */
static uint8_t m_length = sizeof(m_tx_buf);        /**&amp;lt; Transfer length. */


/**
 * @brief SPI user event handler.
 * @param event
 */
void spi_event_handler(nrf_drv_spi_evt_t const * p_event)
{
    spi_xfer_done = true;
    //NRF_LOG_PRINTF(&amp;quot; Transfer completed.\r\n&amp;quot;);
	  //NRF_LOG_PRINTF(&amp;quot; address: %x %x %x %x\n&amp;quot;, val3, val2, val1, val0);

    if (m_rx_buf[0] != 0)
    {
			for (int i = 0; i &amp;lt; sizeof(m_rx_buf); i++)
				{
						NRF_LOG_PRINTF(&amp;quot;%02x&amp;quot;, m_rx_buf[i]);
				}
    }
}

void sendDataToSPI(uint8_t address, unsigned long datagram)
{					
				
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;address, m_length, m_rx_buf, m_length));
	      NRF_LOG_PRINTF(&amp;quot; address: %x\r\n&amp;quot;,address);

				val0 = (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val1 =  (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val2 = (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val3 =  (datagram &amp;amp; 0xFF);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val3, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val3: %x\r\n&amp;quot;,val3);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val2, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val2: %x\r\n&amp;quot;,val2);
		
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val1, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val1: %x\r\n&amp;quot;,val1);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val0, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val0: %x\r\n&amp;quot;,val0);


}

void sendSPI(unsigned long datagram)
{
	static int length= sizeof(datagram);
	APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, (uint8_t *) &amp;amp;datagram, length, m_rx_buf, length));
}
	
int main(void)
{
    LEDS_CONFIGURE(BSP_LED_0_MASK);
    LEDS_OFF(BSP_LED_0_MASK);

    APP_ERROR_CHECK(NRF_LOG_INIT());
    NRF_LOG_PRINTF(&amp;quot;SPI example\r\n&amp;quot;);

    nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG(SPI_INSTANCE);
    spi_config.ss_pin = SPI_CS_PIN;
		spi_config.miso_pin=SPI_MISO_PIN;
		spi_config.mosi_pin=SPI_MOSI_PIN;
		spi_config.sck_pin=SPI_SCK_PIN;
		spi_config.mode=NRF_DRV_SPI_MODE_3;
	
		spi_config.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
    APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler));
				
				/*
				sendDataToSPI(0x80, 0x00000008);
				sendDataToSPI(0xEC, 0x000100C5);
				sendDataToSPI(0xB0, 0x00011F05);
				sendDataToSPI(0xAC, 0x00002710);
				sendDataToSPI(0x90, 0x000401C8);
				sendDataToSPI(0xB2, 0x00061A80);
				sendDataToSPI(0xB1, 0x00007530);
				sendDataToSPI(0xA6, 0x00001388);
				sendDataToSPI(0xA7, 0x00004E20);
				sendDataToSPI(0xA0, 0x00000001);
				sendDataToSPI(0x21, 0x00000000);
				*/
				
				sendSPI(0x80000008);
				sendSPI(0xEC0100C5);
				sendSPI(0xB0011F05);
				sendSPI(0xAC002710);
				sendSPI(0x900401C8);
				sendSPI(0xB2061A80);
				sendSPI(0xB1007530);
				sendSPI(0xA6001388);
				sendSPI(0xA7004E20);
				sendSPI(0xA0000001);
				sendSPI(0x21000000);
				
    while(1)
    {
				unsigned long i_datagram;

        // Reset rx buffer and transfer done flag
        memset(m_rx_buf, 0, m_length);
        spi_xfer_done = false;
				/*
				sendDataToSPI(0xA4, 0x000003E8);
				sendDataToSPI(0xA5, 0x0000C350);
				sendDataToSPI(0xA6, 0x000001F4);
				sendDataToSPI(0xA7, 0x000304D0);
				sendDataToSPI(0xA8, 0x000002BC);
				sendDataToSPI(0xAA, 0x00000578);
				sendDataToSPI(0xAB, 0x0000000A);
				sendDataToSPI(0xA0, 0x00000000);
				sendDataToSPI(0xAD, 0xFFFF3800);
				*/
				sendSPI(0xA40003E8);
				sendSPI(0xA500C350);
				sendSPI(0xA60001F4);
				sendSPI(0xA70304D0);
				sendSPI(0xA80002BC);
				sendSPI(0xAA000578);
				sendSPI(0xAB00000A);
				sendSPI(0xA0000000);
				sendSPI(0xADFF3800);
        while (!spi_xfer_done)
        {
            __WFE();
        }

        LEDS_INVERT(BSP_LED_0_MASK);
        nrf_delay_ms(200);
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162637?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 11:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d49191d-9816-469e-85fa-b255e2907cbc</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;No, NRF_LOG_HEXDUMP_INFO is not available in SDK 11. Then you have to do it in a loop instead. For instance:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;for (int i = 0; i &amp;lt; sizeof(m_rx_buf); i++)
{
    NRF_LOG_PRINTF(&amp;quot;%02x&amp;quot;, m_rx_buf[i]);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162634?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 11:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a7e3abf-1503-4c8d-a61c-0aee809261bf</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;I am using SDK11, Is &amp;quot;NRF_LOG_HEXDUMP_INFO&amp;quot; available in SDK11?&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162594?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 06:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08661426-a4e8-4c87-b31e-3ae7e9600835</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then it is as I assumed, you just print the address of the buffer. A simple way to print the buffer as a hexadecimal string is to use &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/group__nrf__log#ga8b3e3bc44c05013a9fbb27d08acebc9d"&gt;NRF_LOG_HEXDUMP_INFO&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162588?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 06:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6d7deba-af38-4f45-bd02-d2baf3726006</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The m_rx_buf is declared as the following:&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. */
static volatile bool spi_xfer_done;  /**&amp;lt; Flag used to indicate that SPI instance completed the transfer. */
long long MISO = 0x8000000008;
#define TEST_STRING &amp;quot;0x8000000008&amp;quot;

unsigned char val0, val1, val2, val3, val4;

static uint8_t       m_tx_buf[] = {0x80};           /**&amp;lt; TX buffer. */
static uint8_t       m_rx_buf[sizeof(TEST_STRING)+1];    /**&amp;lt; RX buffer. */
static uint8_t m_length = sizeof(m_tx_buf);        /**&amp;lt; Transfer length. */


void spi_event_handler(nrf_drv_spi_evt_t const * p_event)
{
    spi_xfer_done = true;
    //NRF_LOG_PRINTF(&amp;quot; Transfer completed.\r\n&amp;quot;);
	  //NRF_LOG_PRINTF(&amp;quot; address: %x %x %x %x\n&amp;quot;, val3, val2, val1, val0);

    if (m_rx_buf[0] != 0)
    {
        NRF_LOG_PRINTF(&amp;quot; Received: %x\r\n&amp;quot;,m_rx_buf);
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162531?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:43:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee722a8-5268-4f2b-8cb1-5229cfc2ab38</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That looks OK.&lt;/p&gt;
&lt;p&gt;The way you print the RX buffer you print it as if it was a variable, but the number looks like it is an address (in RAM). So most likely you are just printing a pointer address. How have you declared&amp;nbsp;m_rx_buf?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162520?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 13:53:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9aa09ca-d981-4dbe-93e4-3c7445a0a8e7</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for the reply again.&lt;/p&gt;
&lt;p&gt;Is this correct if I transfer complete date in one go?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;

void sendSPI(unsigned long datagram) 
{ 
    static int length= sizeof(datagram); 
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, (uint8_t *) &amp;amp;datagram, length, m_rx_buf, length)); 
}
.

.
int main()
{
    sendSPI(0x80000008); sendSPI(0xEC0100C5); sendSPI(0xB0011F05); sendSPI(0xAC002710); sendSPI(0x900401C8); sendSPI(0xB2061A80); sendSPI(0xB1007530); sendSPI(0xA6001388); sendSPI(0xA7004E20); sendSPI(0xA0000001); sendSPI(0x21000000);
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One more question:&lt;/p&gt;
&lt;p&gt;if (m_rx_buf[0] != 0) { NRF_LOG_PRINTF(&amp;quot; Received: %x\r\n&amp;quot;,m_rx_buf);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;this part is printing&amp;nbsp;&lt;/p&gt;
&lt;p class="p1"&gt;0&amp;gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;Received: 20000034&lt;/p&gt;
&lt;p class="p1"&gt;0&amp;gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;Received: 20000034&lt;/p&gt;
&lt;p class="p1"&gt;0&amp;gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;Received: 20000034&lt;/p&gt;
&lt;p class="p1"&gt;0&amp;gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp; &lt;/span&gt;Received: 20000034&lt;/p&gt;
&lt;p class="p1"&gt;No matter what&amp;#39;s the data send by SPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162509?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 13:22:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f6f6836-ac76-4d40-8baa-5aec0ec00c8b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Assuming you still want a separate write for the address you can do it like this (assuming blocking mode):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void sendDataToSPI(uint8_t address, unsigned long datagram)
{
    static length = sizeof(address); // 1
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;address, length, m_rx_buf, length));

    length = sizeof(datagram); // 4
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, (uint8_t *)&amp;amp;datagram, length, m_rx_buf, length));
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to send the address in a separate transaction (I don&amp;#39;t see any reason why), then you can make an array containing both so that you only have one transaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162500?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 12:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f75431c8-69c5-46c5-a723-283b0269f598</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hi Einar, Can you help me with some example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162501?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 12:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81196fca-c7c7-438c-b915-7d770fc6e72e</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hi Einar, Can you help me with some example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162493?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 12:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36f17bbc-2642-4a83-86f9-7327d6fb9dda</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Why do you split the transaction up like this? You can send&amp;nbsp;up to 255 bytes in one transfer. Just let the puffer pointer point to the start of the data, and set the length field to a multiple of the bytes you have to send.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162483?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 11:33:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a0742de-8320-4d6a-a237-34dada6edd1d</guid><dc:creator>Dhiraj</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. I made this function &amp;quot;sendDataToSPI&amp;quot; which accepts the address and data (as mentioned in the above image). Total 40 bits are transferred via SPI in each data transfer. The first byte is send directly and later 32 byte are split in to 4 byte and sent separately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is this function Ok?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void sendDataToSPI(uint8_t address, unsigned long datagram)
{					
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;address, m_length, m_rx_buf, m_length));
	      NRF_LOG_PRINTF(&amp;quot; address: %x\r\n&amp;quot;,address);

				val0 = (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val1 =  (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val2 = (datagram &amp;amp; 0xFF);

				datagram &amp;gt;&amp;gt;= 8;
				val3 =  (datagram &amp;amp; 0xFF);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val3, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val3: %x\r\n&amp;quot;,val3);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val2, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val2: %x\r\n&amp;quot;,val2);
		
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val1, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val1: %x\r\n&amp;quot;,val1);
	
				APP_ERROR_CHECK(nrf_drv_spi_transfer(&amp;amp;spi, &amp;amp;val0, m_length, m_rx_buf, m_length));
        NRF_LOG_PRINTF(&amp;quot; val0: %x\r\n&amp;quot;,val0);


}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI long data transfer</title><link>https://devzone.nordicsemi.com/thread/162167?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 19:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a47b4ad6-c088-442c-9f3b-b9bb137938bf</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As you write, the SPI driver uses uint8_t, so you must handle it like that. I do not see that as a problem though. You would still provide a pointer to the beginning of the data, so all you should have to do is to cast the pointer and set the length field properly (length in bytes). Lastly you might want to consider the endianess (in case the bytes of your long data type are not transferred in the order you need.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>