cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743ZI2 ADC3 AND DMA

yang hong
Associate II

I am using NUCLEO-STM32H743ZI2. I try ADC3 + DMA, but I confuse ADC3 CLOCK, from cubeMx, I found THERE ARE 3 SOURCE (PLL2P,PLL3R,PER_CK) for adc clock, in manual, it mentioned SCLK and HCLK can be clock resource as well. In RCC adc clock selection, only there are PLL2, PLL3, AND PER_CK to select, so how can I figure out what clock I use? so my understanding is if I choose asynchronous divide, my adc clock only chooses PLL2P, PLL3R OR PER_CK, but if I choose synchronous divide, my adc clock only chooses HCLK or SCLK? right?

right now, it is easy for me to use adc interrupt or poll to acquire data from adc3, but I always failed as long as I use DMA to get data, the error always points to overrun or transfer error. I check the demo program in hal library, it is so strange that all adc_dma examples only include adc dma configuration, but it miss dma channel configuration, so the program can't be run as dma mode without adding dma configuration.

does anybody has stm32h743zi2 adc+dma example using HAL LIBRARY?

tHANK YOU.

2 REPLIES 2
TDK
Guru

> how can I figure out what clock I use?

The clock source is chosen in the "Clock Configuration" tab in STM32CubeMX which sets the RCC_D3CCIPR_ADCSEL bits accordingly. It is PLL2P by default.

> it is so strange that all adc_dma examples only include adc dma configuration, but it miss dma channel configuration

Not sure I agree. Here is one of many examples which configures channels (HAL_ADC_ConfigChannel):

https://github.com/STMicroelectronics/STM32CubeH7/blob/79196b09acfb720589f58e93ccf956401b18a191/Projects/NUCLEO-H743ZI/Examples/ADC/ADC_DMA_Transfer/Src/main.c

If you feel a post has answered your question, please click "Accept as Solution".
yang hong
Associate II

thank you for your information.

I got dma+adc working now. but it is not ideal. I use solution one to define data to ram_d1 instead of DTCMRAM following link below:

https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices

DMA is working now. however, I need disable D-CACHE. I am still working on solution 3 mentioned in the link above, but the article doesn't describe clearly. I still confuses.