2016-12-21 05:31 AM
Good morning,
In my project I use STM32F303RC and I have two ADCs working with DMAs and triggered by a timer. ADC1 has two analog channels to be sampled, ADC4 only one. While I was working with CubeMX 4.17 I had no problems.
Then I updated CubeMX to 4.18. I did not change my program at all, but ADC1 stopped working correctly.
For some reason in the ADC1 configuration CubeMX added this part:
/**Configure the ADC multi-mode
*/ multimode.DMAAccessMode = ADC_DMAACCESSMODE_DISABLED; multimode.TwoSamplingDelay = ADC_TWOSAMPLINGDELAY_1CYCLE; if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK) { Error_Handler(); }This caused the ADC1 to work correctly only in DEBUG mode but not in RUN mode. It took me a bit to find out that this was the cause. When I remove this initialization everything works fine again.
Now, my question is very easy: Is this Multi-mode correct, and I am doing something wrong not considering it, or it is inserted when it should not be?
Thank you very much!
regards
Leo
#adc #cubemx-4.18 #dma2016-12-23 04:27 AM
Dear
Govoni.Leonardo
,We review your issueinternally for checking, and will come back to you as soon as possible.
Thank you for your share and contribution.
Best Reg
ardsImen
2017-01-13 07:04 AM
Hello
Govoni.Leonardo
,You are right, there is a change in CubeMX4.18 on ADC topic.
Previously, the multimode was generated for ADC2 while it accepts only an ADC master handle. This was causing HAL error to be generated and code stuck at this configuration.
From CubeMX4.18, HAL_ADCEx_MultiModeConfigChannel is generated only for ADC master.
That is the correct behaviour.
BR. Eric.