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

How can i set spis rx buffer length on nrf52832 SDK13?

Hi,

i defined spis rx and tx buffer length at:

#define HUB_SPIS_RECV_BUFF_SIZE	1024
#define HUB_SPIS_SEND_BUFF_SIZE	1024

because the rx data length will be vary, so i set:

            hub_spis_recv_len=HUB_SPIS_RECV_BUFF_SIZE;
	nrf_drv_spis_buffers_set(&hub_spis,
							 hub_spis_send_buff,
							 hub_spis_send_len,
							 hub_spis_recv_buff,
							 hub_spis_recv_len);

and when i send data "Nordic thingy welcome!" from demo spi master to this spi slave, spis can't receive data from spi master, the log of spis rx bytes will be 0 in its hanlder. but when i set:

    hub_spis_recv_len=22;
err_code = nrf_drv_spis_buffers_set(&hub_spis,
									 hub_spis_send_buff,
									 hub_spis_send_len,
									 hub_spis_recv_buff,
									 hub_spis_recv_len);

spis can receive the data "Nordic thingy welcome!" from spi master.

why? and when i don't know how long data will be received on spis rx, how can i set the buffer length?
Parents Reply Children
Related