cancel
Showing results for 
Search instead for 
Did you mean: 

STMCubeMX: Incorrect ADC generation for STM32103CBT6

pinkel
Associate
Posted on February 17, 2015 at 13:25

When creating a project for the STM32103CBT6 where ADC1 is configured with 'Scan Conversion Mode' set to 'Enable' the code is generated incorrectly in MX_ADC1_INIT (adc.c).

The generated code shows:

  hadc1.Init.ScanConvMode = ENABLE;

where ENABLE  is defined as (!DISABLE) and DISABLE as 0

This should be:

  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;

where ADC_SCAN_ENABLE is defined as ADC_CR1_SCAN which is defined as ((uint32_t)0x00000100)

Also note that the ASSERT will be triggered with this generated code:

assert_param(IS_ADC_SCAN_MODE(hadc->Init.ScanConvMode));

STM32CubeMX v4.6.0 is used with STM32CubeF1 v1.0.0
1 REPLY 1
stm32cube-t
Senior III
Posted on March 18, 2015 at 10:36

Hello,

This is will be fixed with next 4.7 release.