i2c_write_raw_blocking does not work
@peterharperuk is already working on this.
Since Jul 20, 2024.
Assessment
This issue has not been assessed yet.
Description
As extensively discussed at https://forums.raspberrypi.com/viewtopic.php?t=304074 and https://github.com/raspberrypi/pico-examples/issues/192 i2c_write_raw_blocking does not work.
Using just the SDK, the pico cannot operate as a slave (worker) sending bytes to the I2C bus: it can only read. In fact, the i2c_write_raw_blocking function does not appear to block as expected when there is no request from the master (controller). Moreover, even if there is the necessary request from a controller, which is blocking in a corresponding i2c_read_blocking (assuming it's another pico), no data is transmitted on the bus, the controller continues to stay blocked and the worker continues the operations after the i2c_write_raw_blocking.
Accessing the raw registers directly appears to work, as demonstrated by the examples mentioned in the forum post linked above, namely https://github.com/vmilea/pico_i2c_slave and particularly
https://github.com/vmilea/pico_i2c_slave/blob/master/i2c_slave/include/i2c_fifo.h#L29-L33
and
https://github.com/vmilea/pico_i2c_slave/blob/master/i2c_slave/include/i2c_fifo.h#L43-L47
At the very least a comment should be added in the documentation about i2c_write_raw_blocking not working, to keep until it's fixed.
- Dominant language
- C
- Stars
- 5k
- Forks
- 1.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/pico-sdk
-
hardware_pio
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/pico-sdk#3193 ·
-
pioasm
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
raspberrypi/pico-sdk#3189 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
raspberrypi/pico-sdk#3183 ·
-
c++
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/pico-sdk#3181 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/pico-sdk#3167 ·
All issues in raspberrypi/pico-sdk
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100