You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/13 20:28:09 UTC

[GitHub] [incubator-nuttx] NicholasChin opened a new pull request #275: AT24 EEPROM Increase Polling Retries

NicholasChin opened a new pull request #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275
 
 
   I was seeing an issue with my IMXRT platform that uses an AT24 EEPROM. Driver currently polls the AT24 after a write, and knows the write is completely when the AT24 ACKS the transfer. Right now the IMXRT seems to poll the AT24 so fast that it burns through the 100 retries before the AT24 is ready to accept commands.
   
   500 retries is the absolute max that you should need as 500 NACK'd transaction at 1MHz takes the same time as the AT24's max write time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] NicholasChin commented on issue #275: AT24 EEPROM Increase Polling Retries

Posted by GitBox <gi...@apache.org>.
NicholasChin commented on issue #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275#issuecomment-586332380
 
 
   I've reverted my change back to the original.
   
   Some of the parts that are compatible with this driver ACK/NACK on the command byte, so I have removed both notes since they are inaccurate.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo merged pull request #275: AT24 EEPROM Increase Polling Retries

Posted by GitBox <gi...@apache.org>.
patacongo merged pull request #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #275: AT24 EEPROM Increase Polling Retries

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275#discussion_r379311695
 
 

 ##########
 File path: drivers/eeprom/i2c_xx24xx.c
 ##########
 @@ -253,7 +253,7 @@ static int ee24xx_waitwritecomplete(FAR struct ee24xx_dev_s *eedev,
 {
   struct i2c_msg_s msgs[1];
   int ret;
-  int retries = 100;
+  int retries = 500;
 
 Review comment:
   Reading the note above.
   
   >Note: We should sleep a bit between retries, the write time is around 5 ms,
   > but the bus is slow, so, a few retries at most will happen.	 
   
   makes me think the proper solution should use time (or add a up_udelay()) not a count.
   
   Perhaps something along the lines of https://github.com/PX4/NuttX/blob/px4_firmware_nuttx-8.2/arch/arm/src/stm32/stm32f40xxx_i2c.c#L723-L740 
   
   What to you think?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on issue #275: AT24 EEPROM Increase Polling Retries

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275#issuecomment-586333195
 
 
   Merged... sorry about all of the trouble we are causing you.  We are really not such evil peopl ;)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #275: AT24 EEPROM Increase Polling Retries

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #275: AT24 EEPROM Increase Polling Retries
URL: https://github.com/apache/incubator-nuttx/pull/275#discussion_r379473468
 
 

 ##########
 File path: drivers/eeprom/i2c_xx24xx.c
 ##########
 @@ -266,6 +267,7 @@ static int ee24xx_waitwritecomplete(FAR struct ee24xx_dev_s *eedev,
   do
     {
      ret = I2C_TRANSFER(eedev->i2c, msgs, 1);
+     up_udelay(10);
 
 Review comment:
   up_udelay() should only be used during initialize.  It has disasterous consequences on really time performance since it is a tight loop and blocks all other tasks.  The code was better without this because you had  chance  to get out of the loop sooner.  No, there is almost a guaranteed block, hogging the CPU for a minimum of 10 usec.
   
   You got some very bad advice.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services