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

drivers: adc: stm32: use correct device in dma callback #59834

Merged

Conversation

bwitherspoon
Copy link
Collaborator

The device passed to the DMA callback is the DMA device. Instead use the ADC device available in the private data.

The device passed to the DMA callback is the DMA device. Instead use
the ADC device available in the private data.

Signed-off-by: Brett Witherspoon <[email protected]>
@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 area: ADC Analog-to-Digital Converter (ADC) labels Jun 28, 2023
@gautierg-st
Copy link
Contributor

@heinwessels, you worked on the DMA part for the STM32 ADC. Would you mind taking a look?

@bwitherspoon
Copy link
Collaborator Author

bwitherspoon commented Jun 30, 2023

For a little background, I discovered this issue while adding ADC DMA support for the nucleo_u575zi_q board which uses the GPDMA and this causes a fault. I checked the other STM32 DMA drivers including the new BDMA and the DMA device is passed to the callback.

I will be submitting other fixes for the GPDMA driver which includes adding the nucleo_u575zi_q board to the ADC DMA tests if that is helpful to evaluate this change. But this fix seems like it could go ahead and be submitted.

Copy link
Contributor

@heinwessels heinwessels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems I did get it wrong in the initial implementation. Nice catch!

@gautierg-st
Copy link
Contributor

For a little background, I discovered this issue while adding ADC DMA support for the nucleo_u575zi_q board which uses the GPDMA and this causes a fault. I checked the other STM32 DMA drivers including the new BDMA and the DMA device is passed to the callback.

I will be submitting other fixes for the GPDMA driver which includes adding the nucleo_u575zi_q board to the ADC DMA tests if that is helpful to evaluate this change. But this fix seems like it could go ahead and be submitted.

All contributions are welcome. Concerning the DMA on ADC, ideally its support should be added for all STM32 series. That's in my to-do list of ADC driver improvements, but not in the immediate future, so if you have something working, even if only for U5, you're welcome.

@fabiobaltieri fabiobaltieri merged commit 8f73a47 into zephyrproject-rtos:main Jul 3, 2023
20 checks passed
@bwitherspoon bwitherspoon deleted the dma-callback-device branch July 9, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants