2019-03-11 09:50 AM
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?
2019-03-11 11:56 PM
Hello @Harrold
Thank you for the feedback, can you please share your ioc file?
Best Regards,
Khouloud.
2019-03-12 01:34 AM
Hi Khouloud,
I attached an archive containing two projects including ioc-files and the generated Src and Inc folders:
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
2019-03-12 04:55 AM
@Harrold
You are right, issue will be fixed in the next CubeMX release.
Best Regards,
Khouloud.
2019-03-12 06:29 AM
Thank you for your reply confirming the issue.
Best regards,
Harrold