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

app_twi stuck in internal_transaction_in_progress

Hi,

I'm trying to communicate the nrf52832 with a LIS2DH accelerometer and when I'm trying to read 192 (32*6) bytes of data (to empty the entire accelerometer's FIFO) my code gets stuck on the line 367 of 'app_twi.c' file since the internal_transaction_in_progress=1.

I don't know if using EasyDMA would help... I can read and communicate with the acelerometer without problems, but when I try to read those registers I get this situation.

Also I don't know if it's better to use the app_twi_perform or the scheduled one for this situation.

Thank you!

PD: I have attached the project, is based on the BLE_uart, this way I can send commands to it... (the function is the "read_all_axis").app_uart.rar

Parents
  • I do other transactions before without problems (the internal_transaction_in_progress flag is cleared correctly and I can read/write to the device), but when I try to read those 196 bytes at the same time it's stuck on this bucle... This is the function I call to do the 192 byte read:

    static uint8_t	read_buffer[192];
    
        void read_all_axis(void){
    	static app_twi_transfer_t const transfers[] ={
    		LIS2_READ32_XYZ(&read_buffer[0],192)
    	};
    	uint32_t err_code=app_twi_perform(&m_app_twi, transfers, 192,NULL);
      APP_ERROR_CHECK(err_code);
    }
    
Reply
  • I do other transactions before without problems (the internal_transaction_in_progress flag is cleared correctly and I can read/write to the device), but when I try to read those 196 bytes at the same time it's stuck on this bucle... This is the function I call to do the 192 byte read:

    static uint8_t	read_buffer[192];
    
        void read_all_axis(void){
    	static app_twi_transfer_t const transfers[] ={
    		LIS2_READ32_XYZ(&read_buffer[0],192)
    	};
    	uint32_t err_code=app_twi_perform(&m_app_twi, transfers, 192,NULL);
      APP_ERROR_CHECK(err_code);
    }
    
Children
No Data
Related