NRF54L15 SPIS

hello,
I encountered a problem using SPIS to communicate on nrf54l15

Environment: NRF54L15, NCS2.8.0

When using SPIS for SPI communication, you must first write empty data by spi_transceive_signal (spi_slave_dev, spi_slave_cfg, &s_tx, &s_rx, p_spi_slave_done_sig) before waiting for the master to initiate communication in the thread k_poll (&async_evt, 1, K_FOREVER). Direct k_poll cannot receive instructions from mater

So in order to receive data from the master every time, you must run spi_transceive_signal to write empty data after each spi transmission. When salve actively wants to transmit data,

Method 1: Directly write data to spi_transceive_signal, and then notify the master to read, so that you cannot successfully communicate with the master.

Method 2: First notify the master to read the empty data written by spi_transceive_signal last time, then write data to spi_transceive_signal, and then notify the master to read, so that the data that the slave really wants to upload can be read.

Method 2 has one more transmission. How can we make it possible for the slave to transmit data to the master in one transmission when it wants to transmit?

Parents
  • I think you may be right here, that the SPIS driver in NCS might be needing to have an empty buffer set when you are using spi_transceive_signal the way you are using. But maybe we can try this.

    • After the SPI driver is initialized, you can use nrfx_spis_buffers_set to set the default TX and RX buffers. This way we are high jacking the nrfx use while using the Zephyr based SPIS driver, but I think it might be safe to do so right after the init.
    • When you get a complete handler, you set the next buffers using nrfx_spis_buffers_set to set the buffers again. 

    This might help but I am unsure if I should be suggesting you to use nRFX while using the Zephyr based driver. Otherwise, if you use only Zephyr based driver, then method 2 seems to need to have that extra transmission

Reply
  • I think you may be right here, that the SPIS driver in NCS might be needing to have an empty buffer set when you are using spi_transceive_signal the way you are using. But maybe we can try this.

    • After the SPI driver is initialized, you can use nrfx_spis_buffers_set to set the default TX and RX buffers. This way we are high jacking the nrfx use while using the Zephyr based SPIS driver, but I think it might be safe to do so right after the init.
    • When you get a complete handler, you set the next buffers using nrfx_spis_buffers_set to set the buffers again. 

    This might help but I am unsure if I should be suggesting you to use nRFX while using the Zephyr based driver. Otherwise, if you use only Zephyr based driver, then method 2 seems to need to have that extra transmission

Children
No Data
Related