diff --git a/drivers/i2c/i2c_sam_twi.c b/drivers/i2c/i2c_sam_twi.c index c652e795b22..f7166edc284 100644 --- a/drivers/i2c/i2c_sam_twi.c +++ b/drivers/i2c/i2c_sam_twi.c @@ -293,7 +293,7 @@ static void i2c_sam_twi_isr(const struct device *dev) /* Byte sent */ if (isr_status & TWI_SR_TXRDY) { - if (msg->idx == msg->len) { + if (msg->idx == msg->len || msg->len == 0) { if (msg->flags & I2C_MSG_STOP) { /* Send a STOP condition on the TWI */ twi->TWI_CR = TWI_CR_STOP;