2019-12-07 04:37 AM
Here is a (possibly incomplete) list of threads affected by this CubeMX issue:
https://community.st.com/s/feed/0D50X0000BZFWRISQ5
https://community.st.com/s/question/0D50X0000BbKaA5SQK/haluarttransmitdma-doesnt
https://community.st.com/s/question/0D50X0000BbMcnpSQC/dma-adc-doesnt-work
https://community.st.com/s/question/0D50X0000BWqGdtSQF/haladcstartdma-init-msp-bug
https://community.st.com/s/question/0D50X0000Bfs7MvSQI/stm32f3-adc-with-dma-bug
https://community.st.com/s/question/0D50X0000BcPXk2SQG/32f746-usart-dma-with-stemwin-not-working
This is just in case somebody would like to put up a sticky post with this...
JW
[EDIT] Further development with CubeMX5.5
[EDIT] Problem reappeared 6.3.0 https://community.st.com/s/question/0D53W000011uIPgSAM/adc-dmahandle-is-0
[EDIT] Official method to fix the incorrect order, if project was generated in "incorrect" version of CubeMX: https://community.st.com/s/question/0D53W00001EzCmCSAV/mxdmainit-order-in-the-mainc-file-generated-by-stm32cubemx-how-to-fix
Solved! Go to Solution.
2021-10-12 03:28 AM
> Part of the problem is that nowhere in any of the examples or documentation for DMA does it mention the fact the one must enable the clock to the DMA before doing anything.
True, and the RM may've explicitly mentioned that; OTOH, this is one of the things which are expected to come from general understanding of the modern electronics, a.k.a. "everybody knows" that *all* peripherals (bar some rare exceptions) need to have clock enabled before they are used.
Also, this particular issue stems from the desire of users to generate code entirely by clicking and it's probably a well-deserved lesson to highlight the pitfalls of that process.
JW
2021-11-21 12:11 PM
Thanks for the post... Confirming this bug with this configuration in CubeMX 6.3.0:
ADC group conversion regular, triggered by TIM1. Data via DMA into circular buffer. Memory address wont increment and transaction ends up with ADC overrun.
Changing the order of init routines for DMA and ADC as described above fixes the issue (dma initialized first).
MX_DMA_Init();
MX_ADC1_Init();
2021-12-06 01:35 AM
Also with STM32L0, Cube 6.3.0 and libraries V1.12.1, if
MX_USART1_UART_Init();
precedes
MX_DMA_Init();
then bit MINC in DMA CCR register is not set and DMA reception doesn't work
2021-12-06 02:10 AM
Hi @AndreaC ,
This known issue should be already fixed with STM32CUbeMX 6.4.0 version.
Please try to switch to this new release.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2021-12-06 05:56 AM
Hi Amel and thanks for your reply.
I updated CubeMX and regenereated the code but the issue is still present.
I applied @JStor.2 suggestion to make the solution permanent.
2021-12-06 07:00 AM
Indeed, that is an expected behaviour because you are not generating your project from scratch but based on an ioc file with issue.
This is said, an internal ticket is submitted in order to improve the tool and avoid such side effect.
Internal ticket number: 118838 (PS: This is an internal tracking number and is not accessible or usable by customers).
Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2021-12-06 07:44 AM
Got it, thanks.
2021-12-07 06:08 AM
Here is the official method to fix the incorrect order, if project was generated in "incorrect" version of CubeMX:
JW
2021-12-24 08:32 AM
Thank you. I changed Rank.
2022-03-25 08:35 PM
Unfortunately, the bug persists in version 6.5 (I'm working with STM32F756, Nucleo board)
The work-around is to call
__HAL_RCC_DMA1_CLK_ENABLE()
and/or
__HAL_RCC_DMA2_CLK_ENABLE()
before calling any of the ...Init functions.
Peripherals using DMA assume DMA configuration functions (register manipulations) are working (if called)--and this only happens if the DMA clocks are first enabled. Sent a message Imen Dahmen.