theHuanter 11/30/2023 03:29 PMI was running the good case and received the following output:
status: 0b10000
status: 0b1011100110100
Read request pending, processing...
Received register:0x02
replayed with 0x10
status: 0b1011110010000
the status in the second line indicates, that there was a master requesting a "read". (bit 5). The slave then reads the addressed register 0x02 and sends out 0x10 back to the master. The state after that is in the last line where bit 5 is disabled (no read request pending) but bit 7 is enabled which according to the datasheet of the RP2040 means, that the master did not ACK the reading of the data.
on the ESP32 master side the code looks as follows:
[test] DEBUG: Starting...
[test] DEBUG: scanning start...
0x08
0x11
[test] DEBUG: done bye
It scanned for I2C devices and found the device with 0x08 and then is requesting a read (as posted above) and in the good case also received the 0x11 (I actually send 0x11 not 0x10, the print out was hardcoded in the rp2040).
the state on the RP2040 stays like this. Could it be that the toit implementation somehow does not aknowledge the receiving of that byte and therefor leaves the I2C in a weird state? I am pretty sure that I2C works perfectly fine with toit, I used it a lot already.