vxj9800 opened a new issue #4746:
URL: https://github.com/apache/incubator-nuttx/issues/4746


   I have been working on adding RP2040 hardware support to PX4-Autopilot which 
uses Nuttx as the RTOS. The only thing missing in this 
[PR](https://github.com/PX4/PX4-Autopilot/pull/18083) right now is the 
I2C_RESET.
   
   The datasheet of 
[RP2040](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf) states 
that the MCU has Bus Clear Feature (Page 478) which can handle the problem of 
SDA stuck to LOW. Thus, it makes sense that the rp2040_i2c_reset() function in 
[rp2040_i2c.c](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/src/rp2040/rp2040_i2c.c)
 file just returns OK since the hardware is taking care of the problem 
automatically, I presume.
   
   I would like to know if I am thinking in the right direction or not. If yes, 
then I think the rp2040_i2c_reset() should rather return the state of the bus, 
that is whether it is stuck or not. This way, the i2c implementation of PX4, or 
any other app for that matter, will know whether the bus clearing attempt was 
successful or not. Then `select ARCH_HAVE_I2CRESET` could be added to the 
[Kconfig](https://github.com/apache/incubator-nuttx/blob/master/arch/arm/Kconfig)
 file to allow defining `CONFIG_I2C_RESET`. It is important to define 
`CONFIG_I2C_RESET` since a some parts of i2c implementation in PX4-Autopilot 
depends on this.


-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to