2021-11-29 04: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.
2021-11-30 01: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:
The project will be correctly generated.
Hope this will help. Otherwise do not hesitate to raise any feedback.
Khouloud.
2021-11-29 05:10 AM
This is a known bug. Maybe in the new version of CubeMX it's fixed.
JW
2021-11-29 06: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.
2021-11-29 07:35 AM
Hi,
I'm using STM32CubeIDE Version: 1.7.0
Matt.
2021-11-29 07: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.
2021-11-29 08: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();
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
2021-11-29 02:26 PM
Well that makes sense why the update made no difference.
is there a way to update the IOC file?
Cheers
matt.
2021-11-29 02: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
2021-11-30 01: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:
The project will be correctly generated.
Hope this will help. Otherwise do not hesitate to raise any feedback.
Khouloud.