Issues with BT classic and I2C

ibtibt
Posts: 2
Joined: Thu Dec 14, 2023 11:26 am

Issues with BT classic and I2C

Postby ibtibt » Thu Dec 14, 2023 12:46 pm

Hello, I've developed a code a few years ago that ran on IDF 3.3 that used BT classic to exchange data with a mobile device and I2C as a master to exchange messages with another slave microcontroller. Recently I updated IDF to version 5.1 and ported the old code to the new IDF version. Everything works fine except for one thing: occasionally, during a master read, the read buffer arrives corrupted.

Basically what happens is that when I read a sequence of n bytes a byte goes missing from the sequence, so that a certain number of bytes after that is shifted, and then a random byte (that is not the one who went missing) is added to the original sequence so the bytes after that are correct.

The issue arises when I operate BT and I2C at the same time, if I disconnect the BT device the issue disappears. It happens occasionally, I exchange messages every 100ms and only one message in around 5 to 10 minutes get corrupted. Still, it's a critical issue that I haven't managed to solve. I "fixed" the problem by making the second microcontroller send me the message again but I would also like to solve the reliability issue behind.

Some other info:

I checked the I2C messages with an oscilloscope and I verified that the message that arrives is correct

I tried lowering the I2C frequency from 100kHz to 10kHz but nothing changes

I tried varying the size and frequency of the BT messages both received and sent but it doesn't seem to particularly affect the rate at which the corruption occurs

Has anyone had this issue? Thank you for the help!

ibtibt
Posts: 2
Joined: Thu Dec 14, 2023 11:26 am

Re: Issues with BT classic and I2C

Postby ibtibt » Sat Dec 16, 2023 9:30 am

So I researched a bit into the issue and found this:

https://github.com/espressif/esp-idf/issues/7781

It seems like the issue is present since IDF 4.4 and still hasn't been resolved, can anyone confirm this?

Who is online

Users browsing this forum: No registered users and 108 guests