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

SPI dependent on softdevice?

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?

Parents
  • I did not initialize sd, that is the whole point. Because I don't want softdevice involved when working with microESB, because then I would need timeslot API.

    I upgraded to SDK 10, and now SPI works without softdevice, but microESB does not.

    sd_ functions cannot be called if the softdevice is not initialize, and you can't use NRF_ stuff directly when the softdevice is enabled.

Reply
  • I did not initialize sd, that is the whole point. Because I don't want softdevice involved when working with microESB, because then I would need timeslot API.

    I upgraded to SDK 10, and now SPI works without softdevice, but microESB does not.

    sd_ functions cannot be called if the softdevice is not initialize, and you can't use NRF_ stuff directly when the softdevice is enabled.

Children
No Data
Related