cancel
Showing results for 
Search instead for 
Did you mean: 

DMA _Init() being called in wrong place by code generator

mantisrobot
Associate III

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 */

1 ACCEPTED SOLUTION

Accepted Solutions

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:

  1. 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=.....
  2. After saving the modification, re-open the .ioc file with latest CubeMX version 6.4.0 ( STM32CubeIDE Version: 1.8.0).
  3. Through Project Manager view > Advanced Settings tab, make sure that the initialization functions are correctly ordered and re-generate your project:

0693W00000GZRkyQAH.pngThe project will be correctly generated.

Hope this will help. Otherwise do not hesitate to raise any feedback.

Khouloud.

View solution in original post

10 REPLIES 10

This is a known bug. Maybe in the new version of CubeMX it's fixed.

JW

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.

Hi,

I'm using STM32CubeIDE Version: 1.7.0

Matt.

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.

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();

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

Well that makes sense why the update made no difference.

is there a way to update the IOC file?

Cheers

matt.

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

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:

  1. 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=.....
  2. After saving the modification, re-open the .ioc file with latest CubeMX version 6.4.0 ( STM32CubeIDE Version: 1.8.0).
  3. Through Project Manager view > Advanced Settings tab, make sure that the initialization functions are correctly ordered and re-generate your project:

0693W00000GZRkyQAH.pngThe project will be correctly generated.

Hope this will help. Otherwise do not hesitate to raise any feedback.

Khouloud.