-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add support for multiple channel sampling to STM32 ADC driver #19882
Comments
@cybertale, if you're interested: DMA + ADC ;-) |
Maybe there is an intermediate version possible, similar to what @anangl suggested to me here: #19652 (comment) ? I also wanted to use the scan functionality of the Gecko ADC for multiple channels, but his suggestion works just as well. |
@gmarull @erwango This is on the to do list, but has to be done after the DMA driver. Here is some explanation: #17375 (comment) |
Add support for multi-channels conversion is not hard, but it will raise overrun errors on many STM32 SoCs without DMA. |
@cybertale Thanks for the update! I can help with the implementation based on DMA support branch, I'd like to have it for a project I'm working on (F100R8). I have F3XX, F4XX and H7XX boards to perform testing. |
Interesting. At least the adc_read function should return some error code to indicate that this is not implemented. |
Closing, there's a newer issue describing the same request. #32288 |
Is your enhancement proposal related to a problem? Please describe.
Multiple channels can't be sampled using a single
adc_read
call. For example,will result in channel
8
being sampled after callingadc_read(dev, &seq)
, but not channel9
.The reason for this behavior is that STM32 ADC driver does not support ADC "scan" mode. Only a single acquisition is configured: https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/adc/adc_stm32.c#L273
Describe the solution you'd like
Be able to have all channels in the sequence sampled with a single
adc_read
call.Describe alternatives you've considered
Implement scan mode on the STM32 ADC driver. Note that a DMA is required for such mode, not sure how to make the DMA peripheral to be used configurable, Kconfig option?.
Additional context
N/A
The text was updated successfully, but these errors were encountered: