AnsweredAssumed Answered

STM32l4 FW 1.10 ADC Rank assert

Question asked by Miha Mohorčič on Nov 15, 2017
Latest reply on Mar 5, 2018 by Jeanne Joly



I have ADC set like so (Code generated by CubeMX):  

  sConfig.Channel = ADC_CHANNEL_1;
  sConfig.Rank = 1;
  sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5;
  sConfig.SingleDiff = ADC_SINGLE_ENDED;
  sConfig.OffsetNumber = ADC_OFFSET_NONE;
  sConfig.Offset = 0;

However this fails in stm32l4xx_hal_adc.c file in function: 

HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig)

Specifically assert on 



I assume generated code should look like this: 

  sConfig.Rank = ADC_REGULAR_RANK_1;

Is this correct or am i missing something about this part of code?