ErichStyger/McuOnEclipse_PEx

MCUx.h which is includes when assembling portasm.s causes problems with IAR

martin-mm opened this issue · 4 comments

MCUx.h which is includes when assembling portasm.s causes problems with IAR since <yvals.h> is included then which only works with the compiler

MCUx.h includes Cpu.h:

#if MCUC1_CONFIG_SDK_VERSION_USED == MCUC1_CONFIG_SDK_PROCESSOR_EXPERT
/* Include shared modules, which are used for whole project /
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "Cpu.h" /
include CPU related interfaces and defines */

Cpu.h includes PE_Types.h which includes <stdint.h> which includes <yvals.h>

The problem with the IAR is now that portasm.s includes FreeRTOSConfig.h which includes MCUx.h.
Yvals.h now can only be used with the compiler but not with the assembler:

#if (IAR_SYSTEMS_ICC < 8) || (IAR_SYSTEMS_ICC > 8)
#error "<yvals.h> compiled with wrong (version of IAR) compiler"
#endif

Solution to this:

When generating MCUx.h then exlude the include-files if IAR assembler is running:

#if MCUC1_CONFIG_SDK_VERSION_USED == MCUC1_CONFIG_SDK_PROCESSOR_EXPERT
/* Include shared modules, which are used for whole project /
#ifndef IASMARM
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "Cpu.h" /
include CPU related interfaces and defines */
#endif

should be: #ifndef IASMARM

#ifndef IASMARM

bugtracker seems to eat the leading and trailing two underscored

Thanks, I have fixed that one and verified it with IAR using a FreeRTOS project. The fix is in 076353b. Additionally, I had to update the port file for using the new macros in case the Kinetis SDK is used (might not be the case for you), see a17211a