STM32F3xx ADC common control register initialisation bug

Report here problems in any of ChibiOS components. This forum is NOT for support.
mspieler
Posts: 1
Joined: Thu Oct 19, 2017 7:55 pm
Been thanked: 1 time

STM32F3xx ADC common control register initialisation bug

Postby mspieler » Thu Oct 19, 2017 8:03 pm

Hi,

We discovered that the defines STM32_ADC_ADC12_CLOCK_MODE and ADC_DMA_MDMA are never written to the ADCx_COMMON->CCR register in adc_lld_init().

The issue is on following lines in ChibiOS/os/hal/ports/STM32/LLD/ADCv3/hal_adc_lld.c:544

Code: Select all

#if STM32_ADC_USE_ADC1
  rccEnableADC12(FALSE);
  rccResetADC12();
  ADC1_COMMON->CCR = STM32_ADC_ADC12_CLOCK_MODE | ADC_DMA_MDMA;
  rccDisableADC12(FALSE);
#endif


We found the following workaround:

Code: Select all

#if STM32_ADC_USE_ADC1
  rccEnableADC12(FALSE);
  rccResetADC12();
  __NOP(); // wait for peripheral to reset/turn on
  ADC1_COMMON->CCR = STM32_ADC_ADC12_CLOCK_MODE | ADC_DMA_MDMA;
  rccDisableADC12(FALSE);
#endif


ChibiOS version: GitHub mirror, branch chibios/stable_17.6.x, commit 05c21e002f4b943a4b04e36c76c73e03cecd3cc6
Compiler: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 6.3.1 20170620
Platform: STM32F303CCT6
Board: https://github.com/cvra/motor-control-board
Source: https://github.com/cvra/robot-software/ ... l-firmware

Michael

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest