Conversation
Contributor
Author
|
Hi @ttmut , could you please take a look at this PR? I wasn't able to assign you as a reviewer. Thanks! |
Contributor
|
Hi @haluk-k, I believe this is not necessary anymore since zephyrproject-rtos/zephyr@eeef2b9 |
Contributor
Author
|
Hi @ttmut, I think the change you mentioned will solve the problem. Therefore, I will close this PR, since it seems to be unnecessary. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Initialize the SPI RevA1 TX and RX DMA channel state fields to
E_NO_DEVICEduring static initialization.The Zephyr MAX32 SPI driver calls
MXC_SPI_Shutdown()before the firstSPI initialization. Since the static SPI state array was zero-initialized,
both DMA channel fields initially contained channel
0.As a result,
MXC_SPI_RevA1_Shutdown()treated DMA channel 0 as anacquired channel and released it. A subsequent SPI DMA transfer attempted
to use the released channel and returned
E_BAD_PARAM.Changes
channelTxtoE_NO_DEVICEfor every SPI instancechannelRxtoE_NO_DEVICEfor every SPI instanceRoot Cause
The default zero initialization of the static SPI state array represents a
valid DMA channel number. However, before
MXC_SPI_RevA1_InitState()iscalled, no DMA channel has actually been acquired by the SPI driver.
Calling shutdown during this state therefore releases DMA channel 0
incorrectly.
Expected Result
The initial SPI shutdown does not release DMA channel 0 unless the SPI
driver previously acquired it. SPI DMA transfers can subsequently use the
configured DMA channels without returning E_BAD_PARAM.