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

spi while loop stuck

Hello ! I am trying to read WHO_AM_I register from a LSM9DS1 IMU. I have spi_update_imu_data() as my callback for when the spi transfer completes and inside it I make spi_xfer_done=true. Inside a timer_timeout_handler, I first call nrf_drv_spi_transfer(&spi, m_tx_buf, m_length, m_rx_buf, m_length) where m_tx_buf[2] = {0x80 | WHO_AM_I, 0x00} and m_rx_buf[3] = {0x00, 0x00, 0x00}. The board gets stuck when after the transfer I do while(!spi_xfer_done){spi_xfer_done = false;}.

Can somebody please help me on this issue ? I am using nrf51822 with s130 with the softdevice enabled.

Parents Reply Children
No Data
Related