BBB I2C Driver/Kernel Question

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RogerMcManus
 
Posts: 2
Joined: Sun Aug 04, 2019 11:30 am

BBB I2C Driver/Kernel Question

Post by RogerMcManus »

I think this will be a very easy question for an informed person to answer, but unfortunately I have not been able to figure it out after hours of googling.

Current problem: I am building a project which uses I2C to communicate between some hardware and a beaglebone black. Occasionally I was finding that the beaglebone would crash (and USB connection to a connected PC would drop), which I have decided is due to issues with the I2C bus recovery (i.e. it doesn't happen) in the case of a missed digital pulse (or one device getting stuck). There is a standard method for recovery of an I2C bus in such cases, which I found has been added to recent linux kernels, for example as demonstrated here: https://elinux.org/Tests:I2C-bus-recovery
With that in mind I upgraded my Beaglebone to the latest Debian 10/Linux 4.19 version to try to get the most reliable platform, and I am using the Adafruit_GPIO library.

Question: My current understanding is that the sending/receiving of digital bits happens in a kernel driver that is part of my operating system, NOT the Adafruit_GPIO library. Therefore, I have concluded all bus recovery functions and such are NOT part of the Adafruit_GPIO library. Is this correct?

I have searched through the library and can't find them (bus recovery algorithms) there, though I also cannot find the file i2c_omap.c (which I expected to be in drivers/i2c/busses/i2c-omap.c) anywhere in my operating system, which from what I have read is responsible for bus recovery. If anyone could point me to where I can find the core code responsible for I2C communications, that would be most appreciated.

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: BBB I2C Driver/Kernel Question

Post by drewfustini »

Hello, you raise an interesting question. I do not believe that the Python module does any bus recovery.

I can followup with Robert Nelson and Jason Kridner from BeagleBoard.org to see if they have any insights,.

Additionally, there is also the BeagleBoard.org community mailing list where they are both active:
https://beagleboard.org/discuss

User avatar
RogerMcManus
 
Posts: 2
Joined: Sun Aug 04, 2019 11:30 am

Re: BBB I2C Driver/Kernel Question

Post by RogerMcManus »

Thanks for the reply!
Since updating to the 4.19 linux kernel it does seem much more stable. I have tried deliberately removing pullup resistors on SDA/SCL to see if that can cause it to fail (which it has resisted so far!), so I have to say, it seems as if the newer operating system included useful stability patches!

That said, it would be good to know more. I wrote a message on the Beaglebone forum you linked a few days ago, but I haven't seen the thread go up yet. Perhaps the administrators take some time to approve new threads? I don't know... Any advice would be greatly appreciated!

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: BBB I2C Driver/Kernel Question

Post by drewfustini »

Robert Nelson replied to me to ask how you are powering the board?

Looking at that elinux article , we don't have CONFIG_I2C_GPIO_FAULT_INJECTOR enabled in our kernel build to run the testing.

I don't seem to see your message on the google group: https://groups.google.com/forum/#!categ ... eagleboard

Could you forward it to [email protected]?

I will send you an invite to our BeagleBoard.org slack (based on your adafruit profile email) so you can ask questions on the #dev channel.

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”