Xilinx / Xilinx/embeddedsw.github.io

Can't use repeated start for write-then-read with iicps

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
24
Forks
17
PR merge metrics
No merged PRs in 30d

Description

I was trying to use the iicps driver to communicate with a chip that requires a write (internal address setup), repeated start, then a read transaction in order to read data.

I found that using XIicPs_MasterSend() always resulted in an explicit STOP and START condition between the write and read transactions (see protocol analyzer trace). I found AR#61665 which says there is a hardware issue in generating interrupts if you do a READ, repeated start, READ process.

It looks like the code linked below was added to XIicPs_MasterSend(), but based on comments should have been added to XIicPs_MasterRecv() in order to deal with AR#61665. Indeed, if I move that block from XIicPs_MasterSend() to the end of XIicPs_MasterRecv() I'm able to generate a repeated start condition after write transactions, and I get expected interrupts at the end of both the write and read transactions (see second protocol analyzer trace).

https://github.com/Xilinx/embeddedsw.github.io/blob/d1a863466203fde812b52fedaf9bcb590b0fbf76/iicps/src/xiicps_master.c#L146

Original Trace (red is stop condition, green is start condition):
image

Fixed Trace (red is stop, green is start/re-start):
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in xiicps/src/xiicps_master.c at the linked block in XIicPs_MasterSend(), then compare it with XIicPs_MasterRecv() and the AR#61665 behavior described in the issue. Reproduce a write-then-read transaction with the iicps driver and verify that the trace shows a repeated start, with expected interrupts completing both transactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.