The problem in getting it work with ESP32 is that the bno 055 use clock-stretching that make ESP32 to go into timeout as i2c master also at 10kHz.
Checking the communication with Pulseview I've noticed that the clock stretching may be some times 1ms at 100kHz.
I've modified the file esp-idf/components/driver/i2c.c adding more clock pulses to the timeout modifing the I2C_MASTER_TOUT_CNUM_DEFAULT like this
Code: Select all
#define I2C_MASTER_TOUT_CNUM_DEFAULT (8 * 8 * 2)
My problem is that if i2c fall into timeout just after sending the addres write the bno 055 goes to error, and I'vo to reconfigure the bno, losing a lot of precious time for my application.
Here a pic of the error from i2c side
So I've fall into a very "bad" idea, the idea is to try to make an i2c bitbang, before satrting with this huge and "ugly" idea (huge and ugly because C is a little dificult for me because I'm an OOP programmer with languages like VB.Net or C#), I'll like to knof if exsist some other "less" difficult alternatives.
Thank you so much!