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.
I'm getting the same multiple errors of the kind that were asked about in a thread from 2010.
http://www.keil.com/forum/17977/
However the link at the bottom of that thread (that I assume has the answer) is dead. Does anyone have any suggestions?
The errors are of the form:
C:\Keil\ARM\Inc\ST\STM32f10x\STM32F10x_type.h(23): error: #256: invalid redeclaration of type name "s32" (declared at line 470 of C:\Keil\ARM\Inc\ST\STM32F10x\STM32F10x.h")
I'm getting similar error messages for all the other types s8, s16, u8, u16, u32, etc. and also for things like SET/RESET and ENABLE/DISABLE
Now I see that STM32F10x_type.h and STM32F10x.h are both in the same folder. Each defines these types differently as follows:
STM32F10x_type.h line 23 is: typedef signed long s32;
STM32F10x.h, line 470 is: typedef int32_t s32;
In the block at the top of the file STM32F10x_type.h, it says that it is V2.0.1, dated 06/13/2008. In the comment block at the top of the file STM32F10x.h, it says that it is V3.4.0, dated 10/15/2010. However the file save date for both is 10/17/2011 at 5:01pm so they must have come from the same download.
My questions: 1) Why is there a duplication of these defines in these two files in the same folder? 2) Why are they defined differently? 3) Where does the type "int32_t" come from because it is certainly not a native C data type while "signed long" is a native C data type? 4) What do I have to do to fix this issue so my project will compile?
Thanks!
Without looking at the sepcific files, I would guess that:
STM32F10x_type.h only contains a number of data types - suitable for inclusion in an assembler file when interfacing C and assembler.
STM32F10x.h does not only contain data types, but also other information not supported by a normal assembler, and intended for inclusion in C or C++ files.
I might of course be really off here, but it is quite common that the assembler can process C include files but only supports a subset of the contents you want to store in a header file for use with the C/C++ source files.
Anyway - the same source file isn't supposed to include both header files.