cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7,STM32H743 ADC with DMA

Volker Bremauer
Associate III
Posted on October 11, 2017 at 15:09

In summer 2017, I started an project with the STM32F767 on the Nucleo board, because the H743 was still announced but not available. For some weeks I got the new Nucleo board of the STM32H743.

After I transferred the code from the F767 to the H743, I recognized the not working DMA interrupt. The DMA interrupt was working on the 767 perfectly. So I reduced the code of the F767 and the H743 (by using cube) to only this function for see what�s the difference.
  • TIM3 managed 4 PWM Signals (22KHz) and triggers the ADC1 on falling edge and call the interrupt call back function. (LED GREEN toggles).
  • When ADC1 conversion is finished, the DMA is triggered and copies the data.
  • When the DMA transfer is completed, the call back function is called, and the BLUE LED toggles

I can�t see, why the interrupt for the DMA at the STM32H743 is not working!

Have somebody done something like this already and was successful?

I put both projects for Cube and the AC6 workbench to the attachment. Hope somebody can help me.

BR Volker

#stm32h743 #stm32h7
35 REPLIES 35
Posted on October 12, 2017 at 11:00

Would be helpful to have some working HAL examples from ST.

I have the same problem with Ethernet.

Posted on October 12, 2017 at 11:14

Hi Joerg,

thanks for your spending time. I already also read your problem with the Ethernet.

Maybe there is a bug in the init of the DMA process.

I also not understand, why the cube not automatically reserves a D2 Ram domain for DMA transfer.

- Volker -

Volker Bremauer
Associate III
Posted on October 12, 2017 at 14:00

Problem solved !

Two things have to be observed:

  1. hadc1.Init.ConversionDataManagement =

    ADC_CONVERSIONDATA_DR;

    have to change to:

    hadc1.Init.ConversionDataManagement =

    ADC_CONVERSIONDATA_DMA_CIRCULAR;

    If only this done the 

    HAL_DMA_IRQHandler(&hdma_adc1);

    appears and run into

    hdma->ErrorCode |= HAL_DMA_ERROR_TE;

    --> this already can be done in the Cube definition

  2.  Memory location need to be defined in the D2 domain section see e.g. my linker and source file changes.

Than

HAL_DMA_IRQHandler(&hdma_adc1)

calls  void

HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)

{

and all work fine.

- Volker -

Posted on October 12, 2017 at 14:03

Congrats.

Posted on October 12, 2017 at 14:27

+1

Posted on October 29, 2017 at 19:41

Bremauer.Volker

This looks like a very nasty bug in the Cube, took me almost a day to track this one down. Found the solution in this thread eventually

I noticed that after modifying the linker script, the link stage takes way longer. Do you get the same thing?

Thanks,

Evgeny

Posted on October 30, 2017 at 08:10

Hi Evgeny,

I did not pay attention to that.

So I can not tell you if something has changed.

BR Volker

Posted on November 06, 2017 at 15:45

Hey

Bremauer.Volker

,

Have you, by any chance, experimented with BAM mode? To have D3 inDRun (ADC3+BDMA) while D1/D2 in DStandby?

Thanks,

Evgeny

Posted on November 07, 2017 at 09:47

Hey Evgeny,

sorry no, not needed

BR Volker

Posted on June 05, 2018 at 11:40

Hi Volker, could you outline briefly what were the 'source file changes' for the memory location definition?

Thank you.