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

nRF52832 SPI slave event can not receive

hi :

i send characters of SPI master of 52DK to SPI slave of our target board(Nordic nRF52832), our target board use SDK v12 spis example. but spi slave event can not rececive from SPI master. my code as below:

#ifndef SPIS1_ENABLED
#define SPIS1_ENABLED 1
#endif

void spis_event_handler(nrf_drv_spis_event_t event)
{
    if (event.evt_type == NRF_DRV_SPIS_XFER_DONE)
    {
        spis_xfer_done = true;
        NRF_LOG_INFO(" Transfer completed. Received: %s\r\n",(uint32_t)spis_rx_buf);
    }
}

spis init()
{
    nrf_drv_spis_config_t spis_config = NRF_DRV_SPIS_DEFAULT_CONFIG;
    spis_config.csn_pin		= APP_SPIS_CS_PIN;
    spis_config.miso_pin	= APP_SPIS_MISO_PIN;
    spis_config.mosi_pin    = APP_SPIS_MOSI_PIN;
    spis_config.sck_pin     = APP_SPIS_SCK_PIN;
	
    APP_ERROR_CHECK(nrf_drv_spis_init(&spis, &spis_config, spis_event_handler));	
}

main()
{
    while (1)
    {
        memset(spis_rx_buf, 0, spis_rx_length);
        spis_xfer_done = false;

        APP_ERROR_CHECK(nrf_drv_spis_buffers_set(&spis, spis_tx_buf, spis_tx_length, spis_rx_buf, spis_rx_length));
		
        while (!spis_xfer_done)
        {
            __WFE();
        }
        
    }
}

please give me a suggest, thanks

Related