We are using TMS320DM355 in one of our Products. It is acting as slave-device on the I2C Bus. For this I have made some changes to the I2C Driver in 2.6.18 Kernel. This seemed to work fine for over two years now. Recently we have created a Software update for the device. Now we have the problem that the I2C Device sometimes got stuck, but let me explain in detail what we have done:
- First of all, after system start, UBL (unmodified from DVSDK 2.10) gets loaded from the NAND.
- Then UBL loads UBOOT. We have modified UBOOT. UBOOT sets GIO 014 and GIO 015 as Inputs, and PIN R13 and R14 from I2C_SDA/SCL to GIO 014 and GIO 015 within PINMUX3 Register. Why we do so? We have experienced that DM355 blocks I2C on Startup. To avoid this, we set the PINs as Inputs, so that I2C Bus is not blocked.
- Now the Kernel gets loaded (including the I2C Driver). Kernel is not changing PINMUX3!
- When the user-space gets loaded, we load a self-written kernel module which changes PINMUX3 (PIN R13 and R14 got connected to I2C_SDA/SCL). Now DM355 answers with acknowledge when it detects his Slave-address.
We Poll DM355 by the Address set in the I2C-kernel-driver and most times the transfer works fine, but sometimes it doesnt.
So whats happening on the I2C-bus?
When everything works fine:
Start DM355 7Bit Adress ACK 8Bit Data ACK 8Bit Data ACK Stop
When its not working:
Start DM355 7Bit Adress ACK 8Bit Data ACK 8Bit Data ACK SCL and SDA kept low by DM355
I checked Registers of I2C module while the AAS Interrupt occurs:
ICIMR: 0x7F
ICMDR: 0x20
ICSTR: 0x1E18
ICEMDR: 0x0
Same Register Values when failure happens.
But now what is curious:
When the system works fine, I get the AAS-Interrupt and next the ICRDY-Interrupt.
When DM355 blocks the I2C-Bus, there is no ICRDY-Interrrupt after the AAS-Interrupt (but ICIMR is set to 0x7F).
So what is happening here? Without changing anything on the System, the Interrrupt sometimes just not occur!
Are there any Application-Notes on how to use the I2C Module as a slave? (Only found information for master-mode).
On the I2C Bus there is always communication between different devices. Could it be a Problem when for the I2C Module when it gets connected to the bus within a running transmission?
I hope I described my problem in good way and you can help me with it.