You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMSIS Driver: enhance support for UHS-I in MCI API - #325
Repeating all three steps invokes ARM_MCI_UHS_TUNING_START on every iteration, but its definition below says it initializes a new sampling-clock search. A CONTINUE result must preserve the current search and repeat only the tuning-block/result steps; otherwise the documented loop continually resets its progress.
This issue also appears on line 898 of the same file.
This queries the tuning result immediately after START, before any tuning-block transfer has occurred, contradicting the required sequence documented above (start → send tuning block → inspect result). The example can therefore lead consumers to sample an undefined/stale result; add the appropriate tuning-block transfer and completion wait before this call, and repeat it when CONTINUE is returned.
MCI_Events is OR-ed in the callback but never cleared. When tuning returns ARM_MCI_UHS_TUNING_CONTINUE, the transfer-complete bit from the first block remains set, so every later iteration skips this wait and queries the result before its block completes. Clear the bit before each tuning command.
This example declares mci_tune_sampling_clock as returning void, so returning 0U violates its function contract and can make copied sample code fail compilation. Use a value-less return, as on the earlier failure path.
The PREPARE result is ignored, so CMD11 is still sent when the host could not enter voltage-switch state (for example, when this control is unsupported). Check the return value and abort before issuing CMD11 on failure.
This issue also appears on line 359 of the same file.
MCI_Events accumulates callback bits, so COMMAND_COMPLETE can still be set by an earlier card-initialization command. In that case this wait returns immediately and APPLY may run while CMD11 is still active. Clear the completion bit immediately before starting CMD11, as the existing MCI demo does before SendCommand.
Clear stale TRANSFER_COMPLETE before each tuning command
TRANSFER_COMPLETE is never consumed even though this loop can issue up to 40 tuning commands. After the first CONTINUE result, the next iteration sees the previous completion bit and queries ARM_MCI_UHS_TUNING_RESULT before the new tuning block has finished. Clear the bit before each SendCommand.
This rule suppresses ARM_MCI_EVENT_TRANSFER_ERROR for an invalid tuning sample, but the API does not specify which terminal event replaces it; elsewhere TRANSFER_COMPLETE is defined only for successful transfers, while the new example waits exclusively for that event. Define the required terminal event for a CRC-failed tuning block (for example, TRANSFER_COMPLETE with validity reported by ARM_MCI_UHS_TUNING_RESULT) so implementations cannot leave callers waiting indefinitely.
This issue also appears on line 370 of the same file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.