Hi, I am trying to combine SPI, microESB and BLE. BLE and microESB will not be combined in realtime, but rather be two distinct modes, and not run at the same time, and therefore entirely separated.
My question is: What should I watch out for? I have seen that NRF_POWER can't be used directly while the soft device is active. Is SPI doing something with the softdevice if I have SOFTDEVICE_PRESENT in the preprocessor? SPI initialization hangs unless I do:
SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
If I only do instead:
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0);
It will not come past the SPI initialization (spi_master_open).
I also use app_timer_init (APP_TIMER_INIT), nrf_drv_gpiote_init, GPIOTE_CONFIG_OUT_SIMPLE, set_gpiote_handler, set_wake_on_irq_handler.
Seems like APP_ERROR_CHECK(sd_nvic_ClearPendingIRQ(p_spi_instance->irq_type)); is the one in spi_master.c
Do I have to use timeslot API to combine microESB library and SPI?