I am trying to implement NRFX_SPIM to do a simple SPI transmit and receive to grab WHOAMI from an LSM6 IMU device. I am using segger on windows 10, nrf52840 dk, scope attached, SDK 17.0.2, and I am new to Nordic products. SPIM pins are
#define SPIM_CS NRF_GPIO_PIN_MAP(0, 17) // Connected to P0.17
#define SPIM_SCK NRF_GPIO_PIN_MAP(0, 20) // Connected to P0.20
#define SPIM_MOSI NRF_GPIO_PIN_MAP(0, 22) // Connected to P0.22
#define SPIM_MISO NRF_GPIO_PIN_MAP(0, 24) // Connected to P0.24
so that I can try to move this to the nrf52840 dongle if I ever get it working on the DK.
I am aware that plenty of people seem to think that I shouldn't bother, but I really would like to see this simple example working. First, I was getting errors with conflicts in sdk_config.h, but I cleared that up by commenting out the legacy stuff (like SPI_ENABLE, etc.). Now I get a clean compile, but evidently my rx buffer is not in the Data RAM segment, which gives me a NRF_ERROR_INVALID_ADDR. I tried to use memset to clear out the values of the buffer, but this doesn't put the buffer in the right spot either. Is it expected that you create a pointer then assign it a hard address? Because that also isn't working for me, but maybe I am putting it in the wrong spot (0x20001000 didn't work, e.g.). I also tried malloc without success.
EDIT: I tried to assign the buffer to 0x20000000 as per this document, not only do I still get the NRF_ERROR_INVALID_ADDR, but it also causes the ble services to just simply run forever. I had to comment out all the ble functionality to get it to run enough to verify that I still get the SPI error.