This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52 SPI loops when waiting for NRF_SPI_EVENT_READY after initialisation

So I switched from Bluemod+S (nRF51822) to Bluemod+S42 (nRF52832) on my custom board and am trying to adapt my existing code to work on the newer model. Apart from various obvious and some not so obvious changes I managed to figure out myself, I'm now stuck on the initialization of the SPI:

void hal_spi_init()
{
	nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG; 
	spi_config.ss_pin   = NRF_DRV_SPI_PIN_NOT_USED; //slave select is handled seperatly
	spi_config.miso_pin = SPI_MISO_PIN; //defined in  custom_board.h
	spi_config.mosi_pin = SPI_MOSI_PIN; //defined in  custom_board.h
	spi_config.sck_pin  = SPI_SCK_PIN; //defined in  custom_board.h
	uint32_t err_code = nrf_drv_spi_init(&spi, &spi_config, NULL);
	APP_ERROR_CHECK(err_code); //without setting an event handler, the transfer function just waits until the transmission is finished
}

which works without any error. Subsequently I'm trying to send data to the slave, but the nrf_drv_spi_transfer function loops indefinitely at while (!nrf_spi_event_check(p_spi, NRF_SPI_EVENT_READY)) {} in spi_xfer.

It did (still does) work on my old setup with the nRF51822 and I don't understand whats different now.

I already found similar questions here and here but those didn't help me.

I'm using S132 & SDK 12.3.0 (S130 & SDK 12.3.0 on the old setup)

Parents
  • Problem found: The Bluemod+S and the Bluemod+S42 are Pin-compatible ONLY regarding their own firmware when you use an external MCU. But internally, the pins have been rearranged, so the configuration for the spi in my own firmware was simply wrong.

Reply
  • Problem found: The Bluemod+S and the Bluemod+S42 are Pin-compatible ONLY regarding their own firmware when you use an external MCU. But internally, the pins have been rearranged, so the configuration for the spi in my own firmware was simply wrong.

Children
Related