AdaCore / AdaCore/Ada_Drivers_Library
I2C w/16bit mem addr
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 286
- Forks
- 165
- PR merge metrics
- No merged PRs in 30d
Description
I see a punch through issue wrt successive .DR.DR writes for a 16bit mem addr.
In stm32-i2c.adb:621 adding this wait after the end case seems to clean up the issue. Should be benign for 8bit mem addr also. I have not looked at the other 16bit handlers but I assume they will also need this treatment. Certainly read needs it. My sensor is an ST VL6180X Range and ALS sensor. It uses 16bit addresses. On the logic analyzer I do see the address being stepped on by the following read command thereby culling the DR of the LSB for the parts mem addr.
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- We now need to reset and send the slave address in read mode
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
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.
Research direction
Start in stm32-i2c.adb around line 621 and inspect the successive DR writes and the other 16-bit handlers, including reads. Use the reported VL6180X transaction and logic-analyzer behavior as the reproduction case. Done means the 16-bit memory address is preserved through the following read command while 8-bit addressing remains unaffected.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100