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

nRF51422 SPI disable/enable with softdevice

I have an issue with waking up SPI communication after sleep.

Befor I go to sleep I'm disabling SPI communication:

NRF_SPI0->ENABLE = 0;
NRF_SPI1->ENABLE = 0;

Handler function triggered by timer (which is responsible for wake-up) enabling SPI:

NRF_SPI0->ENABLE = 1;
NRF_SPI1->ENABLE = 1;

and send/receive data

err_code = nrf_drv_spi_transfer....

I'm getting err_code = 17 (NRF_ERROR_BUSY?) which causing reset.

When I remove commands:

NRF_SPI0->ENABLE = 0;
NRF_SPI1->ENABLE = 0;
NRF_SPI0->ENABLE = 1;
NRF_SPI1->ENABLE = 1;

SPI communication works fine, but current consumption is higher then expected during sleep

Should I disable SPI in different way?

Regards, Marcin

Parents
  • I was running into this, about 60uA consumtion after calling nrf_drv_spi_init then nrf_drv_spi_uninit.

    I figured out it was NRF_SPI_DRV_MISO_PULLUP_CFG set to NRF_GPIO_PIN_PULLUP in sdk_config.h. Was seting up a pull up on nrf_drv_spi_init , but nrf_drv_spi_uninit wasn't undoing that.

  • Thank you for reporting this. I have forwarded the issue to the developers.

Reply Children
No Data