cancel
Showing results for 
Search instead for 
Did you mean: 

ADC1 and/or ADC2 are able to use DMA for STM32H723ZG

OMarq.1
Associate II

Hello everyone!

I'm trying to use ADC1 and ADC2 with DMA from a NucleoBoard STM32H732 under STM32CubeIDE. I am following the tutorial presented here:

https://www.digikey.de/en/maker/projects/getting-started-with-stm32-working-with-adc-and-dma/f5009db3a3ed4370acaf545a3370c30c

By setting up ADC3 according to the tutorial, everything works as expected. But I noticed that even though I linked DMA1 stream 1 to ADC1 (Figure 1), just like DMA1 stream 0 is linked to ADC3.

 

OMarq1_0-1690541734432.png

I don't get the option to run "DMA Continuous Request" like it does in the "ADC3 Configuration" tab (compare Figures 2 and 3). I've tried just adding these lines manualy to the generated C code without any succes.

OMarq1_1-1690542262529.png

From what I understand from "RM0468 Reference Manual" page 673 mapping of ADC1 and DMA seems possible, but that is far from a beginner's knowledge.

Is this device uncapable to perform a two channel conversion (ADC1 and ADC2) with DMA at the same time? (or at least one with ADC1 or ADC2?)

Some others had problems with the STM32H74 MCU with a bug in the RAM addresses, but I don't think that's the case here when the device can't handle ADC1 and ADC2 and DMA to begin with, and it's a different device.

Thank you for your help

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal

Until now I have only used ADC3 on a H723.

So ADC1 and ADC2 seem to behave quite differently...

I was just curious and started CubeMX.
When setting parameters for ADC1, you first have to enable DMA under the "DMA settings" tab (choose circular),
then you switch back to the "Parameter Settings" tab and for the parameter "Conversion Data Management Mode" you can select "DMA Circular Mode".

It's a lot of stuff, read the datasheet and the reference manual to understand what's happening, and also go through the HAL sources.

View solution in original post

4 REPLIES 4
TDK
Guru

You can definitely use DMA on ADC1, ADC2 and ADC3 all simultaneously and trigger them all continuously, not sure why the option isn't showing up. I suspect it may have to do with the differences between ADC1/2 (16-bit) and ADC3 (12-bit).

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

Dear TDK,

Thank you for your reply, I've tried to make it work only with ADC1 and still no DMA option available at 12-bit or 16-bit. I also naively attempted to add the missing code to ADC1 configuration in main.c (see figure) hoping it would take it, it copiles but does not work.

Any suggestion to make it work? At least only for ADC1 to start.

OMarq1_0-1690967154159.png

Kind regards

LCE
Principal

Until now I have only used ADC3 on a H723.

So ADC1 and ADC2 seem to behave quite differently...

I was just curious and started CubeMX.
When setting parameters for ADC1, you first have to enable DMA under the "DMA settings" tab (choose circular),
then you switch back to the "Parameter Settings" tab and for the parameter "Conversion Data Management Mode" you can select "DMA Circular Mode".

It's a lot of stuff, read the datasheet and the reference manual to understand what's happening, and also go through the HAL sources.

Hello LCE,

Thank you for your helpful reply

I've followed the steps you described and ADC1 is working, even if you select "DMA One Shot Mode" under "Conversion Data Management," which works better for my application. Furthermore, I was able to read from ADC1 and ADC3 at the same time (sequential activation).

"

HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc_buf, ADC_BUF_LEN);
HAL_ADC_Start_DMA(&hadc3, (uint32_t*)adc_buf2, ADC_BUF_LEN);

"

and data was retrieved from both of them. Although for some reason ADC1 drops to 0 by the end of the recording...

Now it seems that this configuration is interfering with one of the two DAC channels I am actuating "simultaneously".

If you have any idea, please let me know.

Thank you in advance.

 

Kind regards