cancel
Showing results for 
Search instead for 
Did you mean: 

STMcubeMX bug report on adc dual fast interleaved mode.stm32f103c8tx

pooyan
Associate
Posted on February 03, 2017 at 14:59

Hello

When I initialize ADC1 as master and ADC2 as slave in dual fast interleaved mode in CubeMX and generate the code, cpu hangs at   MX_ADC2_Init(); . After some research I found that in   MX_ADC1_Init();  and   MX_ADC2_Init(); the below lines are written:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

  multimode.Mode = ADC_DUALMODE_INTERLFAST;

  if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)

  {

    Error_Handler();

  }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

when I commented these lines in MX_ADC2_Init(); all of the problems solved.

I have attached my main.c code and .ioc file.(problem has been fixed in the main.c file)

thanks....

#stmcubemx-bug-report #adc-dual-fast-interleaved-moed
1 REPLY 1
Kolbjorn Fredheim
Associate
Posted on February 25, 2017 at 13:40

Same problem here with a stm32f103CBT6, hangs on MX_ADC2_Init(); Though I am using ADC_DUALMODE_REGSIMULT. 

Workaround for me is not only deleting

multimode.Mode = ADC_DUALMODE_REGSIMULT;

if (HAL_ADCEx_MultiModeConfigChannel(&hadc2, &multimode) != HAL_OK)

{

    Error_Handler();

}

But also deleting everything hadc2.Init and replacing with hadc2.Init = hadc1.Init;