potential issues in i2c_read_blocking_internal
@Wren6991 is already working on this.
Since Apr 28, 2021.
Assessment
This issue has not been assessed yet.
Description
There may be two issues in i2c_read_blocking_internal.
Issue 1
The first potential issue is these two lines of code:
abort_reason = i2c->hw->tx_abrt_source;
abort = (bool) i2c->hw->clr_tx_abrt;
The first line of code copies the value of the IC_TX_ABRT_SOURCE register to abort_reason. The second line clears the same register, that is, the IC_TX_ABRT_SOURCE register. If the hardware decides to set a bit in the IC_TX_ABRT_SOURCE register after the first line has been executed, but before the second line is executed, the reason for the aborted transfer will be lost. I don't have an example program that can be used to demonstrate this, it's an assumption.
Issue 2
The second potential issue is these two lines of code:
while (!i2c_get_write_available(i2c))
tight_loop_contents();
I'm not 100% sure but I don't think this loop serves any purpose. Can it be removed?
- 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