I am working on the MCAL sample application on EB tresos and S32 Design Studio. I am using GCC compiler and changed the launch.bat file accordingly. I am calling launch.bat with TOOLCHAIN=gcc DERIV=118 PLATFORM=S32K1X parameters.
Ok, consider the following code provided in sys_init.c under src/startup except for the first line "#define S32K144". This block is clearly selecting for the correct configuration depending on your part S32K114, S32K118 etc.
#define S32K144
#ifdef S32K118
#include "s32k118.h"
#endif
#ifdef S32K142
#include "s32k142.h"
#endif
#ifdef S32K144
#include "s32k144.h"
#endif
#ifdef S32K146
#include "s32k146.h"
#endif
#ifdef S32K148
#include "s32k148.h"
#endif
My issue is that there is something weird going on during compilation. If I do not write the first line, #define S32K144 I get many errors stating that a lot of stuff could not be resolved. After a bit of investigating I realize these are defined under these header files ("s32k144.h" etc.) Hence, I thought that I should define a Macro for the part I am using so that the compiler includes one of the header files in this block and added "#define S32K144" line. However, this time it gives a warning saying that this is a re-definition of the Macro, which I haven't defined anywhere else.
Getting curious I changed the line from "#define S32K144" to "#define S32K118" and this time I got a lot of errors stating that there are conflicting types for many Macros.
I think this is happening because the S32K144 Macro is defined somewhere else, and I cannot find where. Where is S32K144 Macro defined? And more importantly, how can I change the part used by the sample application from S32K144 to S32K118?
All answers are appreciated.
M. Talha Uyar