Hello, I'm currently developing an application that uses i2c sensors. However it appears that after I run the app, close it and run it again (sometimes after 2, sometimes after 3 cycles like this) the i2c controller/driver crashes and the app hangs. When I connect to serial port console I get the following output:
[ 5088.637045] i2c-designware-pci 0000:00:09.1: ===== REGISTER DUMP (i2c) =====
[ 5088.637138] i2c-designware-pci 0000:00:09.1: DW_IC_CON: 0x65
[ 5088.637209] i2c-designware-pci 0000:00:09.1: DW_IC_TAR: 0x6b
[ 5088.637278] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_HCNT: 0x2f8
[ 5088.637348] i2c-designware-pci 0000:00:09.1: DW_IC_SS_SCL_LCNT: 0x37b
[ 5088.637417] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_HCNT: 0x87
[ 5088.637486] i2c-designware-pci 0000:00:09.1: DW_IC_FS_SCL_LCNT: 0x10a
[ 5088.637555] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_STAT: 0x0
[ 5088.637623] i2c-designware-pci 0000:00:09.1: DW_IC_INTR_MASK: 0x246
[ 5088.637692] i2c-designware-pci 0000:00:09.1: DW_IC_RAW_INTR_STAT: 0x10
[ 5088.637760] i2c-designware-pci 0000:00:09.1: DW_IC_RX_TL: 0x20
[ 5088.637829] i2c-designware-pci 0000:00:09.1: DW_IC_TX_TL: 0x20
[ 5088.637897] i2c-designware-pci 0000:00:09.1: DW_IC_ENABLE: 0x1
[ 5088.637965] i2c-designware-pci 0000:00:09.1: DW_IC_STATUS: 0x2
[ 5088.638033] i2c-designware-pci 0000:00:09.1: DW_IC_TXFLR: 0x2
[ 5088.638100] i2c-designware-pci 0000:00:09.1: DW_IC_RXFLR: 0x0
[ 5088.638168] i2c-designware-pci 0000:00:09.1: DW_IC_TX_ABRT_SOURCE: 0x0
[ 5088.638236] i2c-designware-pci 0000:00:09.1: DW_IC_DATA_CMD: 0x0
[ 5088.638303] i2c-designware-pci 0000:00:09.1: ===============================
[ 5088.638405] CPU: 1 PID: 3552 Comm: EdisonQuadcopte Tainted: G W O 3.10.98-poky-edison+ # 1
[ 5088.638410] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
[ 5088.638417] task: f4d3da00 ti: f4e02000 task.ti: f4e02000
[ 5088.638479] Stack:
[ 5088.638549] Call Trace:
[ 5088.638950] Code: e8 e7 fa 6b 00 8b 15 00 2d be c1 b8 02 00 00 00 ff 52 7c eb 0f b8 58 89 41 00 e8 f8 9a 2b 00 83 eb 01 74 09 f6 05 80 44 c8 c1 03 <75> e8 f0 80 25 f4 93 d2 c1 fe eb ab 8b 15 00 2d be c1 55 b8 20
[ 5088.638974] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W O 3.10.98-poky-edison+ # 1
[ 5088.638980] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
[ 5088.638988] task: c1bda1c0 ti: c1bd4000 task.ti: c1bd4000
[ 5088.639052] Stack:
[ 5088.639122] Call Trace:
[ 5088.639346] Code: e2 81 e2 00 e0 ff ff 8d 42 08 31 d2 89 d1 0f 01 c8 0f ae f0 89 f6 89 e0 25 00 e0 ff ff 8b 40 08 a8 08 75 07 b1 01 89 f0 0f 01 c9 <85> 1d b8 21 c2 c1 75 0d 8d 55 f0 b8 05 00 00 00 e8 c7 e7 d6 ff
[ 5088.639959] i2c-6: recovery ignore
Restarting Edison makes i2c work again, at least for a few app run/close cycles.
Restarting Edison now doesn't always fix the problem - sometimes it takes 2,3 restarts to get i2c working again. I'm really clueless what's going on, it used to work fine a few days ago.
We'll be more than glad to help you with this issue. To better assist you, we would like to have some more information about your hardware and the issue:
I'm using the Arduino board. My sensor is Pololu altimu-10 v4, 5V i2c, edison is set to 5v too. There are actually 3 sensors on this board each with its own address but I really doubt the sensor itself is causing the issue. As I said on the first run the i2c communication is rock stable, I tested it for a few hours and there were no problems. It starts crashing after I kill the process and run it again. I'm pretty sure this must be a problem with yocto linux drivers not cleaning all the resources properly. I observed a very similar issue with the webcam, where I had to unplug and plug it again after the app that was using it was killed.
Unfortunately I cannot reflash my edison as I spent a bit of time installing all the dependencies and deploying my app on the current system.
Nevermind, I managed to workaround the problem and now I have a i2c deamon app that starts with the system and other processes can ask it for i2c data. This way I avoid killing the process that uses i2c bus.