Welcome! I've started my adventure with STM32 Discovery and Keil uVision v.4.13. I wrote a simple program:
#include "stm32f10x_gpio.h" #include "stm32f10x.h" int i, c; int main(void) { while(1) { for(i=0;i<10000; i++); c=0; for(i=0; i<10000; i++); c=1; } }
to test how the whole thing works. I didn't have to wait long to see this:
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(470): error: #256: invalid redeclaration of type name "s32" (declared at line 23 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") ... D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(503): error: #101: "TRUE" has already been declared in the current scope D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(503): error: #256: invalid redeclaration of type name "bool" (declared at line 55 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h") ... D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(551): error: #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 58 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h") ...
There seems to be a problem with redeclarating the types or structure types. I have no idea what's going on.
I really need your help.
Thanks. GrzesiekG
Is there any reason why you did not look through already made examples that come with MDK for example c:\Keil\ARM\Boards\Keil\MCBSTM32\Blinky\ ?
Or even better c:\Keil\ARM\Boards\ST\STM32-Discovery\Blinky\
There is no "seems to be" about it!
That is clearly & explicitly exactly what the error message is telling you!
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x.h(470): error: #256: invalid redeclaration of type name "s32" (declared at line 23 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
(I've split it into 3 lines just to be easier to read)
Note that the message also tells you where the error occured - line 470 of stm32f10x.h And where the type had originally been defined - line 23 of stm32f10x_type.h
You need to follow the chain of includes to see how this duplication is occurring.
Are you sure you are not mixing different versions of the ST Library?
Different versions of the ST Library do these things in slightlty different ways; this is exactly the kind of error that you will get if you mix them up!
As already noted, have you tried just building any of the supplied examples unaltered?
Stupid ST URL: my.st.com/.../Flat.aspx
Or try: http://bit.ly/hYB41I