Skip to main content
Volker Bremauer
Associate II
October 11, 2017
Solved

STM32H7,STM32H743 ADC with DMA

  • October 11, 2017
  • 5 replies
  • 9612 views
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
This topic has been closed for replies.
Best answer by Volker Bremauer
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 -

5 replies

Nesrine M_O
Associate
October 11, 2017
Posted on October 11, 2017 at 15:33

Hi

Bremauer.Volker

,

Could you please try to have a look to

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/61/f7/a2/df/11/18/48/f2/DM00337702/files/DM003377pdf/jcr:content/translations/en.DM003377pdf

application note, it may help you.

-Nesrine-

Joerg Wagner
Senior III
October 11, 2017
Posted on October 11, 2017 at 16:06

Hi Volker,

it cannot work. Your data is located in DTCMRAM which has no interconnect to any DMA controller.

Figure 1 on page 100 in the Reference Manual RM0433.

You have to modify your linker script to 'move' your data for periphal transmission in Domain D2, for example.

Page 6 of the 'Migration application note' of Nesrine.

- Joerg -

waclawek.jan
Super User
October 11, 2017
Posted on October 11, 2017 at 16:23

DTCMRAM which has no interconnect to any DMA controller.

... except the MDMA, perhaps...

JW

Joerg Wagner
Senior III
October 11, 2017
Posted on October 11, 2017 at 16:33

You are right. MDMA has access to AHB/TCM bus as source and destination. The AXI bus is the opponent in each setting.

But it does not solve this problem and the transfer with other 'peripheral' DMA's.

I think many guys will fall in the trap without doing some extra work in using the new memory model.

- Joerg -

Volker Bremauer
Associate II
October 12, 2017
Posted on October 12, 2017 at 09:36

Hi Joerg,

thanks for your reply.

I have changed the linker script as suggested. I also changed the location for the DMA destination variable: AdcValues_i16.

I checked the location (debugger and map file): Now at RAM-address 0x24000000 (in D2 domain). 0690X00000603ulQAA.jpg

Changes in source file system_it.c:

#define

__SECTION_SRAM1

__attribute__

((section(

''.SRAM1''

)))

__SECTION_SRAM1

int16_t

AdcValues_i16[2];

Changes in the linker script:

/* DMA SRAM section */

  .RAM_D1 :

 

{

       

KEEP(*(.SRAM1))

/*

RAM_D1

section

128K

*/

 

}

>RAM_D1

But the problem still there, the ?DMA2_Stream0_IRQHandler? is not called.

Have you or some other any idea what?s the problem?

Thanks in advance.

- Volker  -

waclawek.jan
Super User
October 12, 2017
Posted on October 12, 2017 at 09:52

What are your DMAMUX settings?

JW

Volker Bremauer
Volker BremauerAuthorBest answer
Associate II
October 12, 2017
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 -

Joerg Wagner
Senior III
October 12, 2017
Posted on October 12, 2017 at 14:03

Congrats.

waclawek.jan
Super User
October 12, 2017
Posted on October 12, 2017 at 14:27

+1

KBera
Visitor II
October 3, 2018

Dear Mr. Volker, can u plz share the files that need modification. I am working on STM32H743ZI Nucleo board.