-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 VREF, TEMPSENSOR, VBAT internal channels to the stm32 adc driver #17375
Comments
Valuable suggestion, I'm currently busy on the dma driver of stm32 in Zephyr. Feel free to try to add it yourself or wait for me or some others to add this support later. |
hey ho |
@StefJar Sorry, the DMA driver is still not finished. 😥 |
I wrote a simple ADC1 DMA demo driver for the STM32F4 MCU. It works fine for my purposes. I put it on github: https://github.com/StefJar/zephyr_stm32_adc1_dma_driver |
@StefJar Thanks for the code! The DMA driver is very close to be merged. I also wanted to add DMA support to the ADC driver, because in zephyr, interrupt is handled first by the OS then our thread, so it becomes a bit slower, thus measuring a sequence of ADC channels is not possible since we have to retrieve ADC result every end of conversion (irq thread in zephyr is slower as I mentioned but ADC conversion can be very fast). After the DMA driver is merged, the first thing I would do in zephyr would be adding DMA support for the ADC driver. |
Is there any progress on this, as the DMA PR is merged now? We are currently working on ADC + DMA for the STM32G4 and also need to read out the internal channels. |
as far as I know the DMA driver got updated, but the ADC driver is not updated yet. |
So sorry guys, I'm busying on my graduation project these several months, what's worse is that my private local server just got attacked several days ago by ransomware and I lost 4TB data, I'm busying on recovering my files now. Have to working on this later. |
Hello. I was wondering how are you interested in approach this task. Are you interested on being able to use APIs like |
@ikerperezdelpalomar Can you check if this issue could be closed, following mege of #34673 ? |
2a96cc0 added support for internal voltage reference source but left out the VBAT, I modified the code to include VBAT: if (__LL_ADC_CHANNEL_TO_DECIMAL_NB(ADC_CHANNEL_TEMPSENSOR) == channel_cfg->channel_id) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_TEMPSENSOR);
} else if (__LL_ADC_CHANNEL_TO_DECIMAL_NB(ADC_CHANNEL_VREFINT) == channel_cfg->channel_id) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_VREFINT);
} else if (__LL_ADC_CHANNEL_TO_DECIMAL_NB(ADC_CHANNEL_VBAT) == channel_cfg->channel_id) {
adc_stm32_set_common_path(dev, LL_ADC_PATH_INTERNAL_VBAT);
} But the ADC value I got doesn't match the voltage on the VBAT. |
@erwango you have any idea bout this? Should I create a new issue or reopen this? |
@ycsin Please open a new issue. |
The current stm32 adc driver is missing the internal channels. Would be great to have at least VREF avaible to improve the reference of the measurement.
The text was updated successfully, but these errors were encountered: