Xilinx / Xilinx/embeddedsw

SPI multi byte transfer hangs in endless loop, when FIFOs are disabled

Open
#152 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
1.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Dear Xilinx,

in xspi.c line 763:

  		DataLen = (InstancePtr->RemainingBytes > InstancePtr->FifosDepth) ?
  				InstancePtr->FifosDepth : InstancePtr->RemainingBytes;

This code alway returns 0, when there are still bytes to send, but the FIFOs are disabled (in hardware).
As a quick fix I changed the code to:

if ((InstancePtr->RemainingBytes > InstancePtr->FifosDepth) && (InstancePtr->FifosDepth != 0)) {
DataLen = InstancePtr->FifosDepth;
}
else {
DataLen =InstancePtr->RemainingBytes;
}

Best regards,
kmikl

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 xspi.c around line 763 and trace the multi-byte transfer path when FIFOs are disabled. Verify that the transfer progresses when FIFO depth is zero, while the existing FIFO-enabled behavior remains correct, and confirm that the loop completes for data larger than one byte.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.