Error_code 0x00000001 (Assume to be NRF_ERROR_SVC_HANDLER_MISSINGO) after SPI communication

Code snippet below produces the error code 0x00000001 during nrfx_spim_xfer:

ret_code_t Spi_Transfer(uint8_t *txBuff, uint8_t *rxBuff, size_t tx_length, size_t rx_length, uint8_t cs)
{
    nrfx_spim_xfer_desc_t xferDesc = NRFX_SPIM_XFER_TRX(txBuff, tx_length, rxBuff, rx_length);

    // Reset rx buffer and transfer flag
    memset(rxBuff, 0, rx_length);
    spi_xfer_done = false;

    /*NOTE: Below manual operation of CS pin is necessary because driver does not 
            natively handle multiple spi slaves on one spi instance */
    nrf_gpio_pin_clear(cs);

    // TODO: use nonblocking mode
    ret_code_t ret = nrfx_spim_xfer(&m_spi, &xferDesc, 0);
    
    while (!spi_xfer_done) 
    {
        __WFE();
    }

    /*NOTE: Below manual operation of CS pin is necessary because driver does not 
            natively handle multiple spi slaves on one spi instance */    
    nrf_gpio_pin_set(cs);

    return ret== NRF_SUCCESS;
}

The same SW in a different project does not produce the error.  The error occurs during attempted communication with a Winbond W25Q64JV and FW crashes.  There is another device on the SPI bus that doesn't have an issue.  What does this error indicate as the reason for it's generation?  We are using SDK nRF5_SDK_17.1.0_ddde560 and SES ARM V5.70a IDE.  Screenshot of error below:

Parents
  • Hello,

    Looking at your code snippet I can see that ''ret'' will get the value from this function nrfx_spim_xfer()

    ret_code_t ret = nrfx_spim_xfer(&m_spi, &xferDesc, 0);

    So, when you are returning ''return ret== NRF_SUCCESS'' ret as NRF_SUCCESS, it will take the value from the function. It's a Boolean operation and here ret will take '1' (Your function returns 0x00000001) as it is equal to NRF_SUCCESS. 

    You can try to see the output only writing ''return ret'' or changing the function here ''ret_code_t ret = nrfx_spim_xfer()''. 

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

Reply
  • Hello,

    Looking at your code snippet I can see that ''ret'' will get the value from this function nrfx_spim_xfer()

    ret_code_t ret = nrfx_spim_xfer(&m_spi, &xferDesc, 0);

    So, when you are returning ''return ret== NRF_SUCCESS'' ret as NRF_SUCCESS, it will take the value from the function. It's a Boolean operation and here ret will take '1' (Your function returns 0x00000001) as it is equal to NRF_SUCCESS. 

    You can try to see the output only writing ''return ret'' or changing the function here ''ret_code_t ret = nrfx_spim_xfer()''. 

    Thanks.

    Best Regards,

    Kazi Afroza Sultana

Children
No Data
Related