We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I am trying to set up my project with a Keil MCBSTM32C Eval Board using STM32F10x_StdPeriph_Lib which is provided with Keil's uVision. I have problems getting things running...
- In my main file, I include stm32f10x_lib.h which is in 'C:\Keil\ARM\INC\ST\STM32F10x' (default include path set by Keil to this directory).
- I added system_stm32f10x_cl.c, core_cm3.c, startup_stm32f10x_cl.s and STM32F10xR.LIB to my project.
- I also have stm32f10x_it.c and stm32f10_it.h in my project.
- I added my board support package (own implementation) to the project (file MCBSTM32C.c and MCBSTM32C.h). Here too, I include stm32f10x_lib.h in MCBSTM32C.h
Now, when building the app, I get errors:
Build target 'MCBSTM32C' compiling main.c... .\BSP\MCBSTM32C.h(233): error: #20: identifier "uint32_t" is undefined main.c(41): error: #20: identifier "__IO" is undefined main.c(41): error: #18: expected a ")" main.c(131): warning: #223-D: function "SystemInit" declared implicitly main.c(139): error: #20: identifier "__IO" is undefined main.c(139): error: #18: expected a ")" main.c(141): error: #20: identifier "nCount" is undefined compiling MCBSTM32C.c... BSP\MCBSTM32C.h(233): error: #20: identifier "uint32_t" is undefined BSP\MCBSTM32C.c(6): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(8): error: #20: identifier "uint32_t" is undefined BSP\MCBSTM32C.c(16): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(21): error: #20: identifier "uint32_t" is undefined BSP\MCBSTM32C.c(26): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(35): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(44): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(53): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(53): error: #20: identifier "EXTI0_IRQn" is undefined BSP\MCBSTM32C.c(53): error: #20: identifier "EXTI15_10_IRQn" is undefined BSP\MCBSTM32C.c(54): error: #20: identifier "EXTI9_5_IRQn" is undefined BSP\MCBSTM32C.c(62): error: #20: identifier "uint32_t" is undefined BSP\MCBSTM32C.c(64): error: #20: identifier "uint32_t" is undefined BSP\MCBSTM32C.c(66): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(68): error: #20: identifier "uint16_t" is undefined BSP\MCBSTM32C.c(250): error: #20: identifier "uint32_t" is undefined Target not created
I am worried about where the definitions of uint32_t, uint16_t, etc. should come from. Also __IO is undefined.
I am not sure if I am doing the exact right thing to use the periph lib that is provided with Keil. www.keil.com/.../mcbstm32c_ex_swlib.htm gives a short hint on how to use, but does not tell anything about required include files... My guess is that there is a "conflicht" between the stm32f10x_lib.h and stm32f10x_cl.h. When I also include stm32f10x_cl.h, there seems to be no problem wit the undefined identifiers, but I get tons of invalid redeclarations.
Any help highly appreciated! Thanks in advance!
-- Regards, Marco