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
  • Hi

    I'm not sure I understand what you're saying here, but it sounds to me like you're just describing how a SPI slave should work. Since it is a slave it just waits/listens to the master to give it "instructions" before doing anything. You can directly write, but then the master won't know to listen by default I think.

    Best regards,

    Simon

  • thanks,
    In other words:

    I want to know how to change the slave send buffer data before the master initiates Spi communication next time after writing the slave send buffer data in spi_transceive_signal(spi_slave_dev, spi_slave_cfg, &s_tx, &s_rx, p_spi_slave_done_sig). I tried k_poll_signal_reset(p_spi_slave_done_sig) and then calling spi_transceive_signal again to write data. I found that the program would be blocked here.

Reply
  • thanks,
    In other words:

    I want to know how to change the slave send buffer data before the master initiates Spi communication next time after writing the slave send buffer data in spi_transceive_signal(spi_slave_dev, spi_slave_cfg, &s_tx, &s_rx, p_spi_slave_done_sig). I tried k_poll_signal_reset(p_spi_slave_done_sig) and then calling spi_transceive_signal again to write data. I found that the program would be blocked here.

Children
No Data
Related