cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-H723zg - Continuous ADC with DMA issues

Uvamosk
Associate II

 

Hello,
 I have a Nucleo-H723ZG that I am trying to setup a Continuous running ADC that fills a buffer VIA DMA. 
I have read tutorials, watched videos, looked at the data sheets and still can't get it working.
Tools:
  CubeMX to generate code
   VScode to compile and debug code
 Hardware:

    NUCLEO-H723ZG

Goal:
  I am trying to have the ADC Continuously trigger and fill the DMA buffer overwriting the old values. 
I'm not attempting to trigger from a timer or any external means. I just want to start the ADC and it be free running. Then I'll handle the data in the buffer else where. 

Currently:
  I can't get anything to happen. The ADC works fine if I set it up for polling and I get correct ADC values. If I set it up for DMA continuous the buffer never gets any values and the ISR HAL_ADC_ConvCpltCallback() never fires. (I used a debug break point inside the isr) 
Update: I found that if I check the ADC_HandleTypeDef hadc1 while debugging it has a ErrorCode == 4 and the DMA_HandleTypeDef hdma_adc1 has an ErrorCode == 1

Setup:
I am using CubeMX to generate a project using "Board Selector" and typing in NUCLEO-H723ZG and selecting the board. I do not select to generate demonstration code but keep all other settings selected. 

Once the project is created I set PA3 to ADC1_INP15 and use the following settings
I also included my main.c along with my .ioc 
Screenshot_2026-02-12_20-09-05.pngScreenshot_2026-02-12_20-08-35.png

Screenshot_2026-02-12_20-08-16.png

5 REPLIES 5
Saket_Om
ST Employee

Hello @Uvamosk 

Please refer to the article below to set your DMA :

STM32H7R/S: How to configure an ADC DMA transfer i... - STMicroelectronics Community

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
Ozone
Principal III

I don't see the specific purpose for DMA in this scenario.
With continuous conversion, you can equally well fetch the results from the ADC register directly.

Hey Saket,
Thanks for jumping in to help. Quick question one of the reasons I ignored anything related to what you posted was I'm using the H723ZGT6U and I had seen people saying it didn't need to have the link files altered and all the stuff I seen about the dcache issue was related to the R/S and 743 parts I believe it was. I don't know the exact models off the the top of my head. Is this just a Cortex® M7 thing in general?
I appreciate your help.

I think the plan was to use DMA and Continuous conversion to fill a buffer then on half_full ISR set flag so that the RTOS task knows where to collect values from and process them.

You have a valid point that using oversampling and more conversions the same sort of end result could be achieved.

The goal is to primarily read slow changing analog sensors(temperature, etc). Think the target is about 100hz sampling. This will all be abstracted behind a API for our higher level developer to use.

TDK
Super User

1) Ensure the buffer is placed somewhere the DMA can access. Sounds like this is the primary issue.

DMA is not working on STM32H7 devices - STMicroelectronics Community

 

2) Set DMA to CIRCULAR mode, not normal, if you want it to continue more than one buffer-loop.

 

Consider loading a working ADC/DMA example and going from there.

STM32CubeH7/Projects/NUCLEO-H743ZI/Examples/ADC/ADC_DMA_Transfer at e109a24f043ec5e6d446c7a8ef31aa57029c7168 · STMicroelectronics/STM32CubeH7

 

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