pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Enable I2C to answer to read option in a slave mode

Open igorbezsmertnyi opened this issue 2 years ago • 2 comments

Hi there 👋

I'm trying to use RPi pico as an i2c slave and connect it to the Nvidia Jetson Nano board via an i2c bus. Currently, I'm facing a problem because for some reason Nvidia Jetson requires -r(read flag) when I try to run the i2cdetect command, (i2cdetect -y -r 0). The other devices work fine, but pico stacked after sending ack and pulled SCL to 0. That's how it looks on the analyzer screen

Screenshot 2023-09-11 at 9 11 07 PM

And that's how it should look like (other device)

Screenshot 2023-09-11 at 9 14 20 PM

Also, I did a small research and found this piece of code in pico-sdk. But those lines aren't used anywhere.

If somebody had the same issues as me, please help me modify the pico-sdk in a proper way to enable it to proceed connection process.

igorbezsmertnyi avatar Sep 11 '23 22:09 igorbezsmertnyi

I don't know if it helps, but have you looked at #1205 and https://github.com/raspberrypi/pico-examples/tree/master/i2c/slave_mem_i2c ?

lurch avatar Sep 12 '23 23:09 lurch

@igorbezsmertnyi - the TX FIFO is probably empty and the slave is stalling the bus by pulling SCL low (i.e. stretching the clock). Look at your code and make sure you keep feeding the FIFO with data.

progvault avatar Mar 15 '24 05:03 progvault