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

Send data received on ble nus to SPI

I merged ble_app_uart with spi peripheral example, normal working like bluetooth connectivity, spi sending and receiving is working fine, but i want to transmit data received on ble_nus to SPI, instead of uart. i tried this line just after err_code = app_uart_put(p_evt->params.rx_data.p_data[i]);

nrf_drv_spi_transfer(&spi, p_evt->params.rx_data.p_data[i], 10, m_rx_buf, 10);

But no luck, i am not able to receive data on spi.

Parents
  • Hi,

    What is on the other side of the SPI bus? Do you get any error codes when trying to send the data with nrf_drv_spi_transfer()?

    It may not be a good idea to place the call inside the for-loop. The SPI can send the whole buffer in one transfer. Try something like this before the for-loop:

    (I set the RX buffer to 0, as I do not know if you expect any response from the SPI slave).

    Best regards,
    Jørgen

  • hi, 

    it worked ! Thanks 

    But i am receiving only 6 bytes on spis side, note more than that?

    for example, if i am sending "abcdefg" i am receiving only "abcdef" at slave board.

Reply Children