cancel
Showing results for 
Search instead for 
Did you mean: 

Cubemx 4.18 ADC Configuration change

leonardo2
Associate II
Posted on December 21, 2016 at 14:31

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 #dma
2 REPLIES 2
Imen.D
ST Employee
Posted on December 23, 2016 at 13:27

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

ards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
Posted on January 13, 2017 at 16:04

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.