DMA _Init() being called in wrong place by code generator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 4:10 AM
The code generator is inserting the DMA_Init() and BDMA_Init functions in the wrong place, leaving DMA not working unless I manually move them after every call code generator run.
I place them in the USER CODE segment above the INIT segment then remove the auto generated versions each time otherwise DMA doesn't work.
/* USER CODE BEGIN SysInit */
MX_BDMA_Init();
MX_DMA_Init();
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART3_UART_Init();
MX_USART2_UART_Init();
MX_TIM2_Init();
MX_DMA_Init(); // PLACED HERE BY CODE GENERATOR
MX_LPUART1_UART_Init();
MX_BDMA_Init(); // PLACED HERE BY CODE GENERATOR
MX_I2C1_Init();
MX_TIM3_Init();
/* USER CODE BEGIN 2 */
Solved! Go to Solution.
- Labels:
-
Bug-report
-
DMA
-
STM32CubeMX
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-30 1:36 AM
Hello @mantisrobot​ ,
As I've already stated, the MX_DMA_Init wrong order is corrected in the latest CubeMX version. Hence newly created project with this version will generate the correct initialization functions order.
For old projects, hereafter some steps to overcome this misbehavior:
- Open the saved .ioc file (already created with 6.3.0 version) with any text editor installed in your machine and delete the line: ProjectManager.functionlistsort=.....
- After saving the modification, re-open the .ioc file with latest CubeMX version 6.4.0 ( STM32CubeIDE Version: 1.8.0).
- Through Project Manager view > Advanced Settings tab, make sure that the initialization functions are correctly ordered and re-generate your project:
The project will be correctly generated.
Hope this will help. Otherwise do not hesitate to raise any feedback.
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 5:10 AM
This is a known bug. Maybe in the new version of CubeMX it's fixed.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 6:36 AM
Hello @mantisrobot​ ,
As already mentioned by @Community member​ , this is a known issue. In fat, it is a regression that was detected with CubeMX 6.3.0 version and corrected in the latest STM32CubeMX 6.4.0 version published lately.
Please make sure to upgrade your CubeMX to the latest version.
Hope that this misbehavior will no longer be reproduced from your side.
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 7:35 AM
Hi,
I'm using STM32CubeIDE Version: 1.7.0
Matt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 7:44 AM
Hi @mantisrobot​ ,
STM32CubeIDE Version1.7.0 is integrating STM32CubeMX 6.3.0 version. A new version of STM32CubeIDE is available: version 1.8.0 aligned with the latest STM32CubeMX 6.4.0.
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 8:35 AM
I see.
I have just done a software update, I now have:
STM32CubeIDE
Version: 1.8.0
Build: 11526_20211125_0815 (UTC)
STM32CubeMX
Version: 6.4.0-RC4
Build: 20211122-2105 (UTC)
The MX_DMA_Init(); is still in the incorrect order:
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART3_UART_Init();
MX_USART2_UART_Init();
MX_TIM2_Init();
MX_DMA_Init();
MX_LPUART1_UART_Init();
MX_I2C1_Init();
MX_TIM3_Init();
MX_USART6_UART_Init();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 12:12 PM
I am not ST and I don't even have or use Cube/CubeMX, but the previous reports indicated, that the order of initialization is given in the .ioc file. It means, that once you stored .ioc of a project in the "incorrect" version, the "correct" version won't change the order. Starting a project afresh in the "correct" version should result in correct order of operations.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 2:26 PM
Well that makes sense why the update made no difference.
is there a way to update the IOC file?
Cheers
matt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-29 2:40 PM
Hi Matt,
>> I am not ST and I don't even have or use Cube/CubeMX.
But, isn't .ioc a text file? So, after having properly backed up your project, why don't you simply try to shuffle things around in it? What can go wrong?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-30 1:36 AM
Hello @mantisrobot​ ,
As I've already stated, the MX_DMA_Init wrong order is corrected in the latest CubeMX version. Hence newly created project with this version will generate the correct initialization functions order.
For old projects, hereafter some steps to overcome this misbehavior:
- Open the saved .ioc file (already created with 6.3.0 version) with any text editor installed in your machine and delete the line: ProjectManager.functionlistsort=.....
- After saving the modification, re-open the .ioc file with latest CubeMX version 6.4.0 ( STM32CubeIDE Version: 1.8.0).
- Through Project Manager view > Advanced Settings tab, make sure that the initialization functions are correctly ordered and re-generate your project:
The project will be correctly generated.
Hope this will help. Otherwise do not hesitate to raise any feedback.
Khouloud.
