0

BBB I2C Driver/Kernel Question
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BBB I2C Driver/Kernel Question

by RogerMcManus on Sun Aug 04, 2019 11:40 am

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.

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

Re: BBB I2C Driver/Kernel Question

by drewfustini on Wed Aug 07, 2019 10:32 am

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

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: BBB I2C Driver/Kernel Question

by RogerMcManus on Wed Aug 07, 2019 1:40 pm

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!

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

Re: BBB I2C Driver/Kernel Question

by drewfustini on Wed Aug 07, 2019 2:18 pm

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 drew@beagleboard.org?

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.

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.