2021-12-07 05:05 AM
When DMA is used, the MX_DMA_Init shall always be called before any other HAL_***_Init (where *** is any peripheral with a HW dependency on DMA init code).
A regression was detected in the previous STM32CubeMX version 6.3.0 (STM32CubeIDE Version: 1.7.0 ) generating a wrong order of initialization functions.
This issue was fixed in the latest STM32CubeMX version 6.4.0. Thus, newly created project with this version will generate the correct initialization functions order.
Because the calling order is saved into the ioc file, the misplacement call to MX_DMA_Init() remains the same when trying to migrate automatically an old project from a buggy old version to the fixed version. The order stays the same and the generated code will be unfunctional.
For any old ioc file created by any STM32CubeMX version up to 6.3.0 included, hereafter some steps to overcome this misbehavior:
Solved! Go to Solution.
2022-06-29 04:54 AM
Hello,
This issue is fixed in STM32CubeMX latest release.
V6.6.0 is now available under this Link.
Thanks for your contribution.
Sara.
2022-01-12 04:21 AM
Many thanks for posting this. It saved my sanity after a couple of frustrating days trying to get DMA working for the LPUART and the ADCs.
There are many posts on stackoverflow etc. saying that the DMA must be initialised before the thing that uses it, e.g. ADCs. I had moved the DMA initialisation to position 3 in the start up order (after GPIO and SystemClock_Config) but DMA didn't work. When I moved it to position 2 as shown above, DMA worked. So there must be some interaction between the DMA and the SystemClock_Config initialisation that is preventing the DMA from running correctly.
tldr: Make sure the order is:
2022-02-05 02:59 PM
I have just generated code with this IDE
STM32CubeIDE
Version: 1.8.0
Build: 11526_20211125_0815 (UTC)
OS: Linux, v.5.13.0-28-generic, x86_64 / gtk 3.24.20, WebKit 2.34.4
Java version: 11.0.11
CubeMX Version: 6.4.0-RC4
Build: 20211122-2105 (UTC)
Still: Wrong code. WTF ST?
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_DMA_Init();
2022-04-17 03:38 AM
Version 6.5.0 - same thing!!!
2022-04-17 11:44 AM
@PAkRad ,
is this a project newly started in version 6.5.0, or did you migrate a project created in older version of CubeMX?
JW
2022-04-17 11:53 AM
New project from scratch.
2022-04-17 11:53 AM
@Community member new project from scratch, actually to test the new version.
2022-04-25 09:12 PM
In latest version of cubeMX also same issue not resolved.
MX_GPIO_Init();
MX_ADC1_Init();
MX_DMA_Init();
Dma not working.
2022-04-25 09:17 PM
I deside to switch another MCU.
Lots of bugs and when you design your own product using ST s MCU then you can't get solution immediately.
2022-04-26 04:38 AM
Hello @parth kothiya , @PAkRad ,
I re-did the test from my part on an STM32H7 and I couldn't see the issue, the order is generated correctly.
Could you please share your ioc file and provide us with the exact scenario that led to this issue?
Thanks,
Sara.