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
  • The flag internal_transaction_in_progress should be cleared in the transaction callback. Have you checked if the callback handler (internal_transaction_cb) is called (by printing a log message), or checked with a logic analyzer if the transaction is happening on the TWI bus?

    If you should use app_twi_perform() or app_twi_schedule() depends en your application. Internally, app_twi_perform() use app_twi_schedule(), so the execution will be the same, except that your application will be blocked until the TWI transaction is cempleted.

Reply
  • The flag internal_transaction_in_progress should be cleared in the transaction callback. Have you checked if the callback handler (internal_transaction_cb) is called (by printing a log message), or checked with a logic analyzer if the transaction is happening on the TWI bus?

    If you should use app_twi_perform() or app_twi_schedule() depends en your application. Internally, app_twi_perform() use app_twi_schedule(), so the execution will be the same, except that your application will be blocked until the TWI transaction is cempleted.

Children
No Data
Related