Got defined #error message for ADC2 for STM32F303xx

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
ep.hobbyiest
Posts: 94
Joined: Sun Jun 26, 2016 5:22 pm
Has thanked: 4 times
Been thanked: 1 time

Got defined #error message for ADC2 for STM32F303xx

Post by ep.hobbyiest »

Hi,

I am using one STM32F303xx development board. On that ADC is connected at ADC2_IN12 Port PIN.So, as per that made TRUE for the macro STM32_ADC_USE_ADC2 from mcuconf.h.

And I already made TRUE for the HAL_USE_ADC in halconf.h.

Now after compliation i got following error message.

Code: Select all

 
../../chibios30/os/hal/ports/STM32/STM32F3xx/adc_lld.h:264:2: error: #error "ADC driver activated but no ADC peripheral assigned"
 #error "ADC driver activated but no ADC peripheral assigned"
  ^
 

In HAL i checked only two ADC's are mentioned that ADCD1 and ADCD3 and not ADCD2.

Is it like CHIBI_HAL is not supporting to ADCD2? If support, where should i do changes?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Got defined #error message for ADC2 for STM32F303xx

Post by Giovanni »

Hi,

What version are you using? it works with 16.1 and trunk code.

Giovanni
ep.hobbyiest
Posts: 94
Joined: Sun Jun 26, 2016 5:22 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Got defined #error message for ADC2 for STM32F303xx

Post by ep.hobbyiest »

I am using ChibiStudio_Preview17.7 version.
And I modified STM32F3xx-ADC demo.

In file adc_lld.h, i could see only STM32_ADC_USE_ADC1 and STM32_ADC_USE_ADC3 mentioned not STM32_ADC_USE_ADC2.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Got defined #error message for ADC2 for STM32F303xx

Post by Giovanni »

Hi,

It is possible that you switched to the workspace of ChibiOS 3.0, switch again to 16.1. See the File menu in eclipse.

Giovanni
ep.hobbyiest
Posts: 94
Joined: Sun Jun 26, 2016 5:22 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Got defined #error message for ADC2 for STM32F303xx

Post by ep.hobbyiest »

Yeah, correct. I was giving different path in makefile.

and i think one more correction in chibios adc port code in following path.

In file ../../chibios161/os/hal/ports/STM32/LLD/ADCv3/adc_lld.c : 699 there is mentioned ADCD1instead of ADCD2.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Got defined #error message for ADC2 for STM32F303xx

Post by Giovanni »

Hi,

It has been fixed in latest version, thanks.

Giovanni
Post Reply