Change in simtrace2[master]: I2C: add wait time after write to let EEPROM write

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Jul 24 19:07:22 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10123 )

Change subject: I2C: add wait time after write to let EEPROM write
......................................................................

I2C: add wait time after write to let EEPROM write

The Atmel AT24C02 defines a maximum tWR waiting time after a byte
write of 5 ms before a next write.
Enforcing this wait time also fixed the failed verification in qmod,
where it was reading 0xffff instead of the written value.

Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b
---
M firmware/libboard/qmod/source/i2c.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/firmware/libboard/qmod/source/i2c.c b/firmware/libboard/qmod/source/i2c.c
index 06c7565..a708704 100644
--- a/firmware/libboard/qmod/source/i2c.c
+++ b/firmware/libboard/qmod/source/i2c.c
@@ -185,6 +185,8 @@
 	nack = i2c_write_byte(false, true, byte);
 	if (nack)
 		goto out_stop;
+	/* Wait tWR time to ensure EEPROM is writing correctly (tWR = 5 ms for AT24C02) */
+	mdelay(5);
 
 out_stop:
 	i2c_stop_cond();

-- 
To view, visit https://gerrit.osmocom.org/10123
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b
Gerrit-Change-Number: 10123
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180724/994b9784/attachment.htm>


More information about the gerrit-log mailing list