2021-09-28 09:13 AM
I have setup ADC1 on an STM32G4 in scan mode where the start of conversions is initiated by a timer. I have also setup the DMA in circular mode and configured it such that the ADC results are transferred to an array every time the scan conversion completes. The code generated by CubeMX calls the MX_ADC1_Init() before MX_DMA_Init(). In this order, the DMA doesn't update my array values. However, when I change the order of initialization so that MX_DMA_Init() is called beore MX_ADC1_Init(), everything seems to work fine. I looked in the code briefly, but couldn't figure out why the order of initialization matters. It is also problematic because I have to manually change the order of initialization every time I regenerate code using CubeMX.
Solved! Go to Solution.
2021-09-28 09:33 AM
Hi @BPaik ,
I looked in the code briefly, but couldn't figure out why the order of initialization matters.
Simply because MX_ADC1_Init() tries to update some DMA related registers while its clock isn't activated (with MX_DMA_Init()).
This is well explained by @TDK in this discussion.
It is a known regression in STM32CubeMX 6.3.0. I think that it will be fixed soon. @Khouloud OTHMAN can confirm this.
-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-09-28 09:33 AM
Hi @BPaik ,
I looked in the code briefly, but couldn't figure out why the order of initialization matters.
Simply because MX_ADC1_Init() tries to update some DMA related registers while its clock isn't activated (with MX_DMA_Init()).
This is well explained by @TDK in this discussion.
It is a known regression in STM32CubeMX 6.3.0. I think that it will be fixed soon. @Khouloud OTHMAN can confirm this.
-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-09-29 04:03 AM
Hello @BPaik ,
As already mentioned by @Amel NASRI , this issue was already detected with other STM32 MCUs and raised to our development team to be reviewed and fixed as soon as possible.
I'll surely keep you posted with the updates.
Sorry for any inconvenience that this may cause.
Khouloud.