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

SPI2 init fail while SPI1 is working

Hi All,

currently i am facing one issue with SPI,

i am using SPI 1 and 2 for sending data in two different spi slave ics. in that i am successfully init spi_1 and it works properly.

in SPI_2 i am getting error code 8.  in SDK14.2 while it works in SDK12.0

#define SPI_INSTANCE 1
#define SPI2_INSTANCE     2
static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);   // SPI instanc
static const nrf_drv_spi_t spi_2 = NRF_DRV_SPI_INSTANCE(SPI2_INSTANCE);
init spi2(void)
{
    nrf_drv_spi_config_t spi_2_config = NRF_DRV_SPI_DEFAULT_CONFIG;
    spi_2_config.ss_pin = SPI2_CS;
    spi_2_config.miso_pin = SPI2_MISO;
    spi_2_config.mosi_pin = SPI2_MOSI;
    spi_2_config.sck_pin = SPI2_CLK;
    spi_2_config.frequency = NRF_DRV_SPI_FREQ_4M;
    ret = nrf_drv_spi_init(&spi_2, &spi_2_config, spi_2_event_handler,NULL);
print(LL_ERROR, "SPI initialisation %d\n",ret);
}

this complete solution is working in SDK12.0 and gives error code 8 in SDK14.2

also it shows SPI2_IRQ is not defined. why?

Related