cancel
Showing results for 
Search instead for 
Did you mean: 

After upgrading to Version 5.1.0, the main functions does not call all DMA init routines

Harrold
Associate II

I have DMA, MDMA and BDMA configured for an STM32H742ZIT6. After upgrading CubeMx to Version 5.1.0, the generated main functions only calls two of the three generated DMA init routines.

This issue can easily be reproduced by creating a new CubeMX project and configure BDMA (MEMTOMEM), DMA (also MEMTOMEM) and MDMA (SW request). Then generate code and inspect the generated file main.c. The previous version of CubeMX generated MX_BDMA_Init(), MX_DMA_Init() and MX_MDMA_Init() and all three were called from within main(). The new CubeMX still generates all three init function, but only calls two of them:

...
MX_DMA_Init();
MX_BDMA_Init();
...  

If I remove the configuration for DMA or BDMA, the call to MX_MDMA_Init() reappears.

Is there any explanation for this behavior?

4 REPLIES 4
Khouloud ZEMMELI
ST Employee

​Hello @Harrold​ 

Thank you for the feedback, can you please share your ioc file?

Best Regards,

Khouloud.

Harrold
Associate II

Hi Khouloud,

I attached an archive containing two projects including ioc-files and the generated Src and Inc folders:

  • OurProduct.zip - The ioc-file we use for our product
  • SimpleThreeDmaProject.zip - The ioc-file which I created from scratch with only DMA, MDMA and BDMA (as described in my previous post).

If you take a look at the generated main.c files, you see they both contain all three DMA initialization functions MX_BDMA_Init(), MX_DMA_Init() and MX_MDMA_Init(), but only two of them are called:

OurProduct\Src\main.c:

int main(void)
{
  [...]
 
  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_FMC_Init();
  MX_I2C1_Init();
  MX_QUADSPI_Init();
  MX_SAI1_Init();
  MX_RTC_Init();
  MX_ADC3_Init();
  MX_TIM4_Init();
  MX_UART4_Init();
  MX_TIM2_Init();
  MX_I2C4_Init();
  MX_ETH_Init();
  MX_BDMA_Init();
 
  [...]
}

Function MX_MDMA_Init() is not called.

SimpleThreeDmaProject\Src\main.c

int main(void)
{
  [...]
 
  /* Initialize all configured peripherals */
  MX_MDMA_Init();
  MX_DMA_Init();
 
  [...]
}

Function MX_BDMA_Init() is not called.

Best regards,

Harrold

Khouloud ZEMMELI
ST Employee

​@Harrold​ 

You are right, issue will be fixed in the next CubeMX release.

Best Regards,

Khouloud.

Harrold
Associate II

Thank you for your reply confirming the issue.

Best regards,

Harrold