This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI long data transfer

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 variable for sending data, but not sure how should I send all the data mentioned in above image. Data is very long to be sent as data is of type long long and m_tx_buf is of type const uin8_t *. 

This link embed entire initialisation values of LCD init command in one buffer, do I need to follow the same?

Thanks in advance.

  • 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)?

  • Hello Einar,

    Data is received only once I see on the datasheet.

  • I am reading this Data:

    0> 790A000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000305705000000000000
    0> 790A000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000305705000000000000
    0> 790A000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000305705000000000000
    0> 790A000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000305705000000000000
    0> 790A000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000D0A8FA000000000000
    0> 79AD000000000000000000000000
    0> 7900000000305705000000000000


    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();
            }

  • Hi,

    There have been a few weeks before this last update 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?

Related