raiden00pl commented on code in PR #10092:
URL: https://github.com/apache/nuttx/pull/10092#discussion_r1285460615


##########
arch/arm/src/nrf52/nrf52_i2c.c:
##########
@@ -373,7 +374,9 @@ static int nrf52_i2c_transfer(struct i2c_master_s *dev,
           /* Write number of bytes in TXD buffer */
 
           regval = priv->dcnt;
-          nrf52_i2c_putreg(priv, NRF52_TWIM_TXMAXCNT_OFFSET, regval);
+          nrf52_i2c_putreg(priv, NRF52_TWIM_TXDMAXCNT_OFFSET, regval);
+
+          nxsig_usleep(1);

Review Comment:
   just tested nrf52840-dk with lsm9ds1 over i2c and I don't see any issues. 
   
   400kHz with this change makes the i2c bus inefficient:
   <img width="1389" alt="image" 
src="https://github.com/apache/nuttx/assets/6563055/5fcd4996-8160-4a28-8cc5-19af36734f0e";>
   
   here without sleep:
   <img width="1392" alt="image" 
src="https://github.com/apache/nuttx/assets/6563055/ae735ba2-572a-41f4-897e-708120a747e6";>
   
   <img width="1394" alt="image" 
src="https://github.com/apache/nuttx/assets/6563055/e9d34f1e-847f-4379-861d-4c4dacda23d8";>
   
   So I guess the problem is somewhere else and this change should not be 
applied to nrf52 i2c driver.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to