AnsweredAssumed Answered

STM32CubeMX 4.7.0 Bug Report - ADC1 code generation, wrong rank

Question asked by Andrei Chichak on Mar 24, 2015
Latest reply on Mar 31, 2015 by STM32Cube-T
tl;dr - after converting your project to 4.7.0 check all of the generated code carefully.



I have ADC1 set up so that ranks 1-4 are hooked to channels 0-3 respectively, rank 5 is hooked to vbat, and rank 6 is hooked to the temperature sensor.

The code generated for ranks 2-6 are correct, but rank 1 is generated as a second instance of rank 5, with the correct channel.

The code generated in 4.6.0 was:

  /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
  */
sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = 1;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);

in 4.7.0 reads:
  /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
  */
sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = 5;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);


Outcomes