Hi everyone,
I'm currently developing an application supposed to read through SPI from an extrernal SRAM, i'm using nrfx_spim libraries.
Compilation is flawless but when i try to debug i get NRFX_ERROR_INVALID_ADDR when starting Spi transmission, do you know why and how can i fix it?
These are the vector i'm using as buffers:
/** @brief Transmit buffer initialized with the specified message ( @ref MSG_TO_SEND ). */
static uint8_t m_tx_buffer[10]={0x9f,0,0,0,0,0,0,0,0,0,0};
/** @brief Receive buffer defined with the size to store specified message ( @ref MSG_TO_SEND ). */
static uint8_t m_rx_buffer[10]={0,0,0,0,0,0,0,0,0,0,0};
The spi initialization:
nrfx_spim_t spim_inst = NRFX_SPIM_INSTANCE(SPIM_INST_IDX);
nrfx_spim_config_t spim_config = NRFX_SPIM_DEFAULT_CONFIG(17,
13,
14,
NRF_SPIM_PIN_NOT_CONNECTED);
spim_config.frequency=NRFX_MHZ_TO_HZ(8);
status = nrfx_spim_init(&spim_inst, &spim_config, NULL, NULL);
NRFX_ASSERT(status == NRFX_SUCCESS);
And Transmission:
nrfx_spim_xfer_desc_t spim_xfer_desc = NRFX_SPIM_XFER_TRX(m_tx_buffer, 1,
m_rx_buffer, 6);
status = nrfx_spim_xfer(&spim_inst, &spim_xfer_desc, 0);