I am using cc1310 with Contiki OS, and are currently working with the MCU acting as an I2C slave.
We want to be able to handle unpredictable scenarios as e.g. described in processors.wiki.ti.com/.../I2C_Tips by resetting the I2C slave module. It seems we are able to reproduce such a type of issue by having the master device request data and not put any data in the SDR register for cc1310 to reply. In this case it seems the cc1310 will clock stretch indefinitely - and the only reliable way we found to get out of it is a reboot(!).
Does anyone have any suggestions on a proper reset sequence for the i2c slave module? Our current unsuccessful attempt:
I2CSlaveIntDisable(INT_I2C_IRQ); I2CSlaveIntDisable(I2C0_BASE, interrupt_flags); I2CSlaveDisable(I2C0_BASE); PRCMPeripheralRunDisable(PRCM_PERIPH_I2C0); PRCMPeripheralSleepDisable(PRCM_PERIPH_I2C0); PRCMPeripheralDeepSleepDisable(PRCM_PERIPH_I2C0); PRCMLoadSet(); while(!PRCMLoadGet()); IOCPinTypeGpioInput(I2C_SLAVE_SDA_PIN); IOCPinTypeGpioInput(I2C_SLAVE_SCL_PIN); IOCIOPortPullSet(I2C_SLAVE_SDA_PIN, IOC_NO_IOPULL); IOCIOPortPullSet(I2C_SLAVE_SCL_PIN, IOC_NO_IOPULL);
And then the reverse to bring it back up.
Regards,
Andreas