Topic : Problems with building projects with included ST libraries

Forum : Ride IDE

Original Post
Post Information Post
March 28, 2009 - 6:23pm


i own a STM32Primer and tried to get the USART working.
After a while i figured out that the precompiled ST libraries
where using the wrong value for the crystal (hse_value 8000000 instead of 12000000).

Now i tried to add the source files of the libs to my project
to compile the whole project with the correct hse_value setting.

I'm not able to do this successfully because all i get is the following

\"C:\Programme\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -MD -D_STM32F103RBT6_ -D_STM3x_ -D_STM32x_ -mthumb -mcpu=cortex-m3 "I:\stm32\ride_projects\toggle\library\src\stm32f10x_adc.c" -o "I:\stm32\ride_projects\toggle\stm32f10x_adc.o" -I "." -I "I:\stm32\ride_projects\toggle\library\inc" -c -fsigned-char -g -O1 -ffunction-sections -mlittle-endian
I:\stm32\ride_projects\toggle\library\src\stm32f10x_adc.c: In function 'ADC_TempSensorVrefintCmd':
I:\stm32\ride_projects\toggle\library\src\stm32f10x_adc.c:1261: error: 'ADC1' undeclared (first use in this function)
I:\stm32\ride_projects\toggle\library\src\stm32f10x_adc.c:1261: error: (Each undeclared identifier is reported only once
I:\stm32\ride_projects\toggle\library\src\stm32f10x_adc.c:1261: error: for each function it appears in.)

Can someone can help me out here?

I did the following steps:

1. make a copy of the 'toggle' project
-- copy --> I:\stm32\ride_projects\toggle
2. copy the ST library files to the project
-- copy --> I:\stm32\ride_projects\toggle\library
3. Project properties -> Application Options -> Directories -> set '.;I:\stm32\ride_projects\toggle\library\inc'
4. Project properties -> LD Linker -> Libraries -> ST library - No
5. Build the project -> FAIL

I'm using RIDE7 which comes with the ST Primer



Post Information Post
March 30, 2009 - 10:56am
Raisonance Support Team


The stm32f10x_adc.c file will not compile if the ADC is not activated by the associated defines in the stm32f10x_conf.h file. And as the toggle example does not use the ADC, the "_ADC" and "_ADC1" macros are not defined in the conf.h file. This is how the lib is designed and it is true for all peripherals. You must activate all the peripherals that you plan to use in the conf.h file. And you must not take the c files for the peripherals that you don't want to use.

So you must either remove the stm32f10x_adc.c file from the project, or uncomment the "#define _ADC" and "#define _ADC1". It depends on if you plan to use the ADC in the future. And you must do this for all other peripherals.

Best Regards,


March 30, 2009 - 12:51pm

Thanks for your answer. I'll try it later.

Does that mean that the default precompiled library which comes with RIDE have
all peripheral options enabled? So the whole library will link into the final HEX file?