This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPI communication problem with interfaced sensor getting ASSERTION FAILED?

Hello Everyone,

We are using nRF52840 DK with Segger Embedded Studio (SES) using SDK v15.0 We are sending few command to sensor via SPI for reading sensor value. But while reading sensor value getting asseration failed ERROR at line no: nRF5_SDK_15.0.0_a53641a/modules/nrfx/drivers/src/nrfx_uarte.c:269

When I go to this line saw NRFX_ASSERT(p_cb->state == NRFX_DRV_STATE_INITIALIZED); difficult to understand what exactly problem. Please help me for fixing this issue.

Looking forward your response....!!!

Thanks...

Parents
  • difficult to understand what exactly problem

    Is it?

    The problem is that it is not in the INITLIALIZED state - it needs to be!

    https://en.wikipedia.org/wiki/Assertion_(software_development)

  • Hi,

    By disabled NRF_LOG_BACKEND_UART_ENABLED 0 in sdk_config.h then this error solved but now getting ERROR 17 [NRF_ERROR_BUSY] at the time of sending command over SPI.

     APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, address, sizeof(address), m_rx_buf, sizeof(m_rx_buf))); 

    Thanks,

    Vishal

  • I suggest to connect MISO and MOSI together to first verify that m_rx_buf is a loopback of the address and commands you are sending. However a logic analyzer would speed up debugging a lot.

    Best regards,
    Kenneth

  • a logic analyzer would speed up debugging a lot

    Absolutely!!

    This is a hardware interface - trying to debug it with no view into the hardware is just folly!

  • Yes you are right but right we are not thinking to buy it and don't have any option.

    Actually here is below SPI command sequence that I want to write and read:

    I this my above program snippet is correct, I am getting problem for pressure and temperature measurement. When I send 0Fh & 40h byte then in rx buffer continuous receiving FF bytes.

    Is it necessary to send dummy bytes for read operation through SPI?

    Thanks....

  • Do you not even have an oscilloscope?

  • No, Only have multi-meter with frequency measurements option..

Reply Children
No Data