stm32f10 adc problem

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

Moderator: RoccoMarco

Post Reply
deadlyboy
Posts: 27
Joined: Wed Nov 26, 2014 9:27 am

stm32f10 adc problem

Post by deadlyboy »

hi every body


im trying to have ADC in my stm32f103 ,
i'm sure that every things should work well , but during compilation i get the this error : C:\ChibiStudio\workspace\myProjectName/../../chibios/os/hal/src/hal.c:79: undefined reference to `adcInit' in my hal.c file


from halconf.h i make ADC enable :

Code: Select all

/**
 * @brief   Enables the ADC subsystem.
 */
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
#define HAL_USE_ADC                 TRUE
#endif



and in mcuconf.h i enables ADC1 too :

Code: Select all

/*
 * ADC driver system settings.
 */
#define STM32_ADC_USE_ADC1                  TRUE
#define STM32_ADC_ADC1_DMA_PRIORITY         2
#define STM32_ADC_ADC1_IRQ_PRIORITY         6


from your experiences , what's wrong with my project ??
any help would be great.

thanks in advance
MA
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: stm32f10 adc problem

Post by Giovanni »

Are you using the provided makefiles or other builders?

Looks like some inclusion paths are missing from the project.

Giovanni
deadlyboy
Posts: 27
Joined: Wed Nov 26, 2014 9:27 am

Re: stm32f10 adc problem

Post by deadlyboy »

im using the make file which was in one of example of STM32F1xx in chibi studio preview7

without using adc , every thing compiles well.
can you introduce me where is defined the :
inclusion paths
??
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: stm32f10 adc problem

Post by Giovanni »

Chibistudio preview 7 is quite old, you should verify if the problem is present in the last version. The STM32F1xx ADC test application compiled correctly here.

I also enabled the ADC in the ARMCM3-STM32F103 demo and it compiled.

Giovanni
deadlyboy
Posts: 27
Joined: Wed Nov 26, 2014 9:27 am

Re: stm32f10 adc problem

Post by deadlyboy »

thanks ,
i switched to chibistudio preview 10 (i suppose it using chibios3.0) and compiled adc example for STM32F1xx it works.

but there is 2 problem .
1- i couldn't make my own project in worckspace30 folder , in prev7 i just copy mcuconf.c and .... plus main.c and Makefile and in Make file i changed CHIBIOS directory to ../../chibios
but here it seems not work,
2- we had free running counter in hal which was

Code: Select all

 halGetCounterValue()
but i got error : undefined reference every where i called that function .

so any help would be great.

thanks in advance
MA
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: stm32f10 adc problem

Post by Giovanni »

Hi,

The equivalent function is in the kernel now, see the documentation.

Note that in preview 10 there is also ChibiOS 2.6, you just have to switch to the other workspace.

Giovanni
Post Reply