STM32F303x8 has 2 ADCs (STM32F3xx/stm32_rcc.h issue) Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Dwar
Posts: 12
Joined: Fri Jan 08, 2016 2:04 pm
Location: USA
Has thanked: 4 times
Been thanked: 3 times

STM32F303x8 has 2 ADCs (STM32F3xx/stm32_rcc.h issue)

Postby Dwar » Thu May 05, 2016 9:54 am

Found a problem trying to add ADC to the Nucleo-32 demo with the trunk. The F303K8T6 has 2 ADCs

1) halconf.h: #define HAL_USE_ADC TRUE
2) mcuconf.h: #define STM32_ADC_USE_ADC1 TRUE

See these errors when compiling:

Code: Select all

In file included from ../../../os/hal/ports/STM32/STM32F3xx/hal_lld.h:1149:0,
                 from ../../../os/hal/include/hal.h:32,
                 from ../../../os/hal/ports/STM32/LLD/ADCv3/adc_lld.c:25:
../../../os/hal/ports/STM32/LLD/ADCv3/adc_lld.c: In function 'adc_lld_stop':
../../../os/hal/ports/STM32/STM32F3xx/stm32_rcc.h:227:43: error: 'RCC_AHBENR_ADC3EN' undeclared (first use in this function)
 #define rccDisableADC34(lp) rccDisableAHB(RCC_AHBENR_ADC3EN, lp)
                                           ^
../../../os/hal/ports/STM32/STM32F3xx/stm32_rcc.h:147:20: note: in definition of macro 'rccDisableAHB'
   RCC->AHBENR &= ~(mask);                                                   \
                    ^
../../../os/hal/ports/STM32/LLD/ADCv3/adc_lld.c:733:7: note: in expansion of macro 'rccDisableADC34'
       rccDisableADC34(FALSE);
       ^
../../../os/hal/ports/STM32/STM32F3xx/stm32_rcc.h:227:43: note: each undeclared identifier is reported only once for each function it appears in
 #define rccDisableADC34(lp) rccDisableAHB(RCC_AHBENR_ADC3EN, lp)
                                           ^
../../../os/hal/ports/STM32/STM32F3xx/stm32_rcc.h:147:20: note: in definition of macro 'rccDisableAHB'
   RCC->AHBENR &= ~(mask);                                                   \
                    ^
../../../os/hal/ports/STM32/LLD/ADCv3/adc_lld.c:733:7: note: in expansion of macro 'rccDisableADC34'
       rccDisableADC34(FALSE);
       ^
make: *** [build/obj/adc_lld.o] Error 1


In STM32F3xx/stm32_rcc.h the macro definition assumes 3 or more ADCs are present:

Code: Select all

#if defined(RCC_AHBENR_ADC34EN) || defined(__DOXYGEN__)
#define rccDisableADC34(lp) rccDisableAHB(RCC_AHBENR_ADC34EN, lp)
#else
#define rccDisableADC34(lp) rccDisableAHB(RCC_AHBENR_ADC3EN, lp)
#endif

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 78 times
Been thanked: 60 times
Contact:

Re: STM32F303x8 has 2 ADCs (STM32F3xx/stm32_rcc.h issue)

Postby RoccoMarco » Thu May 05, 2016 9:56 am

I'll take a look to this and eventually fix it. Thanks.



Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests