diff --git a/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c b/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c index b61a73d20..78c000186 100644 --- a/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c +++ b/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c @@ -224,7 +224,7 @@ void adc_lld_start_conversion(ADCDriver *adcp) { /* ADC setup.*/ adcp->adc->SR = 0; - adcp->adc->SMPR1 = grpp->smpr1; + adcp->adc->SMPR1 = grpp->smpr1 | ADC_SQR1_NUM_CH(grpp->num_channels); adcp->adc->SMPR2 = grpp->smpr2; adcp->adc->SMPR3 = grpp->smpr3; adcp->adc->SQR1 = grpp->sqr1; diff --git a/readme.txt b/readme.txt index 3ab56c917..43653b51d 100644 --- a/readme.txt +++ b/readme.txt @@ -131,6 +131,8 @@ - NEW: Increased stacks size in RT test suite from 128 to 192. added an option to override the stack size by defining THREADS_STACK_SIZE in the makefile. +- FIX: Fixed wrong initialization in STM32L1xx ADC driver (bug #1247) + (backported to 20.3.5)(backported to 21.11.3). - FIX: Fixed wrong HSI48 support on STM32L0xx (bug #1246) (backported to 20.3.5)(backported to 21.11.3). - FIX: Fixed wrong DMA definitions for STM32L0xx I2C3 peripheral (bug #1245)