Hello,
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
message:
\"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
C:\Programme\Raisonance\Ride\Examples\ARM\Primer\STM32\toggle
-- copy --> I:\stm32\ride_projects\toggle
2. copy the ST library files to the project
C:\Programme\Raisonance\Ride\Lib\ARM\STM32F10x_LIB\library
-- 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
Regards,
JD
|
Hi,
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,
Vincent
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?
JD