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.
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
@cybertale did do have any progress on that?
@StefJar Sorry, the DMA driver is still not finished. :disappointed_relieved:
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
Maybe @cybertale it can be used as a blueprint for a async AD1 driver using DMA and internal channels ;)
@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.
But I think I can help to add the support for internal channel since the DMA PR needs review now.
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 LL_ADC_CHANNEL_TEMPSENSOR and LL_ADC_CHANNEL_VREFINT to enable each of them? That would cause that if TEMPSENSOR is enabled VBAT can't be used and vice versa, other choice would be to actively switch between them, but that would involve more logic.