Skip to main content
MTrev.2
Associate
August 22, 2021
Question

STM32F769I-DISCO ADC and DAC with DMA not working correctly

  • August 22, 2021
  • 1 reply
  • 3035 views

goodAfternoon,

I am making a TouchGFX project that needs to use the DAC and ADC present on the discovery board using the DMA.

Does the STM32F769I-DISCO TouchGFX code have something that makes so that the DMA doesn't work correctly by default? If so what should I change/add in the TouchGFX code so that the DMA starts working normally?

I made some code in an STM32CubeIDE project and the ADC and DAC work normally.

When I put the same code on the TouchGFX program the ADC callback gives wrong vaiues and the DAC doesn't change value (it has a lookup table of a sinus and is triggered by a timer), I should see a sinus...

If more code is needed just ask, I will gladly write it here if it makes it easier to understand the problem.

Here is the screen that should start the DAC and a screen of part of the MPU settings (generated by touchGFX).

After some tinkering I think the problem is due to the fact that the D-Cache and I-CAche are active and the memory layout with MPU done by TouchGFX. I can't understand how to change the parameters so to make the DMA work correctly with the buffers i create. Did someone had this issue and tried to solve it?

Thankyou for the kind help

-Marco

This topic has been closed for replies.

1 reply

TDK
August 23, 2021

Make sure sine_val is located in memory accessible by the DMA.

You will also need to clean cache prior to starting the DMA.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MTrev.2
MTrev.2Author
Associate
August 24, 2021

Hi, thankyou for the reply. :)

I checked il the buffer is in a place where the DMA can access it. Its in the SRAM1 address 0x20000180 in the .bss, looking at the system architecture of the board both DMA1 and DMA2 have access to it.

I also tried to turn off both the caches and disable memory protection. Nothing changes. It's still not able to write or read from the buffer.

I also tried to clean and invalidate the cache but it gives no results.

Do you have any other idea on what the issue might be?

If I try to do this in a normal project without freeRTOS and TouchGFX with all the same parameters for the DMA ADC, DAC and trigger event timers everything works as expected....

I will keep trying to search whats the problem but it seems I have tried everything my knowledge can allow.

Riccardo Franceschetto
Associate III
December 27, 2021

Ciao @MTrev.2​ , ho avuto lo stesso problema? hai risolto? ti ho mandato un messaggio.