cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 ADC with DMA - DMA-Transfer not initiated

DSchl.1
Associate III

Hi everyone

I'm trying to get the ADC1 running with a DMA transfer on the STM32H757ZI. The goal is to measure 10 channels with 8 samples each and transfer these measurements to a separated SRAM1 buffer with DMA, each time the conversion sequence has been finished.

The problem I have is, that the ADC1 seems to work properly, since I'm reading some data in the DR, but the DMA transfer is never initiated. I have enabled the EOC and EOS interrupts, the corresponding ISR clears the EOC / EOS bits. I have set the DMNGT to DMA circular mode, which I assume enables the DMA functionality for the ADC peripheral. The transfer complete interrupt for the DMA is triggered, but no data is written to the buffer...

In addition, I have used the following DMA settings:

  • DMA1 clock enable
  • Set direction to peripheral to memory
  • disabled FIFO mode
  • Set memory size to Half Word
  • Set memory increment mode to increment
  • Set memory address to SRAM1 buffer address
  • Set mode to dma mode circular
  • Set peripheral size to Half Word
  • Set peripheral increment mode to no increment
  • Set peripheral request to DMAMUX1_REQ_ADC1
  • Set peripheral address to address of the DR
  • Enable TC interrupt

However, there's no data copied into the SRAM1 buffer... what am I missing here? Is there some additional setting I have to enable?

edit: I've set up the buffer according to this link :

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

I'm using Solution 2 - placing the buffer in a different memory region.

Regards

Daniel.

15 REPLIES 15

Hi and sorry for this late reply.. I have setup the ADC without DMA for now... we are developing other parts and are a bit under pressure (as usual)... I'll come back to this as soon as I'm working on the ADC again..

Thanks and regards

Daniel.

Hi,

I am having the same problem, did you find something?

Unfortunately not. We have decided to not use the DMA with the ADC.

SavasSahin
Associate II

Hi DSchl.1,

I faced the same problem.

I do not know if you solve the problem, but you should invalidate cache when DMA transfer completed by using "SCB_InvalidateDCache_by_Addr" function.

All the bests,

Savas

Wrong. The invalidation must be done before starting the reception on a particular buffer by DMA.

An instruction of proper cache management:

https://community.st.com/s/question/0D53W00000oXSzySAG/different-cache-behavior-between-stm32h7-and-stm32f7

Topic about the cache eviction:

https://community.st.com/s/question/0D50X0000C9hGozSQE/weird-cache-writeback-behavior-for-stm32f7508

Hi Piranha,

Thank you for your answer. I will check them.

I align the DMA buffers so that when invalidation no other addresses affected.

After DMA transmission completed. I only invalidate cache with that dma buffer. In this way no need to clean the cache. Cache reloads with new values which was updated by DMA transfer with new values.

This works with stm32h750 and stm32h753/743 devices perfectly.

Will it cause any problems that i can not see yet?

All the bests,

Savas