Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type conflict (uint32_t) vs. (uint32_t:7) leads to overflow (276 vs. 20) #31835

Closed
micnet49 opened this issue Feb 1, 2021 · 1 comment
Closed

Comments

@micnet49
Copy link

micnet49 commented Feb 1, 2021

DMAMUX_SetSource(DEV_DMAMUX_BASE(dev), channel, slot);
and
DMAMUX_SetSource(DEV_DMAMUX_BASE(dev), channel, slot);
use a variable as third argument which is derived from the structure element dma_slot of struct dma_config which is required in the call of the API function
static inline int dma_config(const struct device *dev, uint32_t channel,
.

E.g. if the dma request source kDmaRequestMuxSai1Tx is required and assigned to element dma_slot of struct dma_config this issue leads to a "conversion from 'unsigned int' to 'unsigned char:7' changes value from '276' to '20' [-Woverflow]".

@micnet49 micnet49 closed this as completed Feb 2, 2021
@micnet49
Copy link
Author

micnet49 commented Feb 2, 2021

According to the reference manual i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019, section 5.6.1.2 Channel a Configuration (CHCFGa) only the lower 7 bits are relevant for the source selection (DMA Channel Source (Slot Number)).
However, it has been confusing to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant