summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/i2c-stm32f.c6
-rw-r--r--chip/stm32/i2c-stm32l.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/chip/stm32/i2c-stm32f.c b/chip/stm32/i2c-stm32f.c
index 6c7f58556c..851209557b 100644
--- a/chip/stm32/i2c-stm32f.c
+++ b/chip/stm32/i2c-stm32f.c
@@ -44,9 +44,13 @@
* mode). The slave is supposed to wait forever for the master to read bytes.
* ...but we're going to keep the timeout to make sure we're robust. It may in
* fact be needed if the host resets itself mid-read.
+ *
+ * NOTE: One case where this timeout is useful is when the battery
+ * flips out. The battery may flip out and hold lines low for up to
+ * 25ms. If we just wait it will eventually let them go.
*/
#define I2C_TX_TIMEOUT_SLAVE (100 * MSEC)
-#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
+#define I2C_TX_TIMEOUT_MASTER (30 * MSEC)
/*
* We delay 5us in bitbang mode. That gives us 5us low and 5us high or
diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c
index 8c256d5cb4..b2f528aa4f 100644
--- a/chip/stm32/i2c-stm32l.c
+++ b/chip/stm32/i2c-stm32l.c
@@ -34,8 +34,12 @@
* mode). The slave is supposed to wait forever for the master to read bytes.
* ...but we're going to keep the timeout to make sure we're robust. It may in
* fact be needed if the host resets itself mid-read.
+ *
+ * NOTE: One case where this timeout is useful is when the battery
+ * flips out. The battery may flip out and hold lines low for up to
+ * 25ms. If we just wait it will eventually let them go.
*/
-#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
+#define I2C_TX_TIMEOUT_MASTER (30 * MSEC)
/*
* Delay 5us in bitbang mode. That gives us roughly 5us low and 5us high or