I'm having trouble using the NRFX SPIM driver on the NRF52810 w/ Softdevice (S112). (SDK15.0.0)
I'm able to initialize but when I go to use nrfx_spim_xfer without the callback it hangs. If I use the callback, it returns but eventually the application error handler fires with an unknown/weird error.
(this one specifically)
<error> main: id = 1, pc = 61386, file = KGJ`h??@h, line number: 536871936, error code = 1405 =
It typically doesn't show up unless I actually step through.
This one is definitely a head scratcher. I am using pin 21 for something else but both in the boot loader and the main app I removed the CONFIG_GPIO_AS_PINRESET define. (I've seen that sometimes pins with alternate functions may cause this error, for me no so much)
Actual code as follows:
// Initialize SPI_INSTANCE
nrfx_spim_config_t spi_config = NRFX_SPIM_DEFAULT_CONFIG;
spi_config.mosi_pin = LED_SDI_PIN;
spi_config.sck_pin = LED_SCK_PIN;
err = nrfx_spim_init(&spi, &spi_config, NULL, NULL);
VERIFY_SUCCESS(err);
The transfer setup and execution looks like this
static uint8_t data[] = {0xaa, 0xaa};
nrfx_spim_xfer_desc_t xfer_desc = NRFX_SPIM_XFER_TX(data, 2);
// Transfer test 16 bits
nrfx_spim_xfer(&spi, &xfer_desc, 0);
This has to be some weird cocktail of me setting something wrong or initializing something else that interferes with SPIM. Any thoughts are appreciated!