STM32Cube code generator bug for STM32G030J6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-29 4:34 PM
The generated code has wrong order for MX_DMA_Init() that doesn't work:
MX_GPIO_Init();
MX_ADC1_Init();
MX_DMA_Init();
...
Correct code is:
MX_GPIO_Init();
MX_DMA_Init();
MX_ADC1_Init();
...
note: STM32CubeIDE Version: 1.7.0 Build: 10852_20210715_0634 (UTC)
Solved! Go to Solution.
- Labels:
-
ADC
-
Bug-report
-
DMA
-
STM32CubeMX
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-30 12:09 AM
STM32CubeMX does not (yet) know where the function calls should best be placed.
You can manually reorder the generated function calls within STM32CubeIDE (embedded STM32CubeMX) as well as in the standalone STM32CubeMX:
- on the top select tab Project Manager
- on the left select Advanced Settings
- select the function call to be moved, e.g. MX_ADC1_Init();
- click on the tiny, tiny move button above the blue header of the table (top right) to move it to the desired position
If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-30 12:09 AM
STM32CubeMX does not (yet) know where the function calls should best be placed.
You can manually reorder the generated function calls within STM32CubeIDE (embedded STM32CubeMX) as well as in the standalone STM32CubeMX:
- on the top select tab Project Manager
- on the left select Advanced Settings
- select the function call to be moved, e.g. MX_ADC1_Init();
- click on the tiny, tiny move button above the blue header of the table (top right) to move it to the desired position
If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-04 10:20 AM
@Peter BENSCH​ if STM32CubeMx doesn't know about that, how is the user supposed to know? Just trial and error until it works, or is there some documentation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-04 12:36 PM
Cube may be more better, but ST guys freeze its ability to basic!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-11 2:01 PM
Thanks for this info. However I notice this by my self, while comparing with my old application for F401. I now tested to create a new project in STM32CubeMX 6.3.0 (with STM32Cube_FW_F4_V1.26.2) for an F401 device and still the order of MX_ADC1_Init() and MX_DMA_Init() is correct. So why is it wrong order in generated code for a G0B1 device?
By the way, I think this is wrong in description of "in case of usage of DMA" in file stm32g0xx_hal_adc.c start at row 115:
(++) Insert the ADC interruption handler function HAL_ADC_IRQHandler()
into the function of corresponding DMA interruption vector
DMAx_Channelx_IRQHandler().
I believe it should be:
(++) Insert the DMA interruption handler function HAL_DMA_IRQHandler()
into the function of corresponding DMA interruption vector
DMAx_Channelx_IRQHandler().
//Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-11 5:16 AM
This answer is just unacceptable. This issue has made projects frustrating and unprofitable for us. If MXCube doesn't do the right order then it should have a disclaimer to make you aware of this fact.
Kevin
