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

nRF52832 NRF_ERROR_BUSY from nrf_drv_twi_tx()

i used aplication twi_sensor form nRF5_SDK_12.3.0_d7731ad and i use s132.i conected mpu9060 every time get error on my terminl NRF_ERROR_BUSY.There is exemle of codemain.c and scren from terminal d324ssa42d3434234.png what i do wrong?

new main main.c and new terminal d38dkvjxcfk0965234.png i get msg sucses but i have not value from register. i have same resalt without mpu

this is variant main.c as you sad.i get msg sucses but i have not value from register. i have same resalt without mpu

Parents
  • Sorry for not being more specific in my previous comment. You need to make sure the previous transfer is finished before the next is executed. This can be achieved either by adding the while loop inside your read and write functions, after each call to nrf_drv_twi_rx\nrf_drv_twi_tx, or by checking the while loop before calling your read/write functions (except the very first call). Which solution is best for your application depends on how often you do twi read/write, and if there are other tasks that can be executed while waiting for the transfer to finish. If you go for the second option, you will still need to include the checking of the while loop between tx and rx in your read function.

Reply
  • Sorry for not being more specific in my previous comment. You need to make sure the previous transfer is finished before the next is executed. This can be achieved either by adding the while loop inside your read and write functions, after each call to nrf_drv_twi_rx\nrf_drv_twi_tx, or by checking the while loop before calling your read/write functions (except the very first call). Which solution is best for your application depends on how often you do twi read/write, and if there are other tasks that can be executed while waiting for the transfer to finish. If you go for the second option, you will still need to include the checking of the while loop between tx and rx in your read function.

Children
No Data
Related