Hi community, Hi NXP experts,
I am facing a compilation error in the I2c module of the NXP Realtime driver package SW32G_RTD_4.4_3.0.2_HF01:
[ 20%] Building C object CMakeFiles/RTA-SK.dir/C_/NXP/SW32G_RTD_4.4_3.0.2_HF01/eclipse/plugins/I2c_TS_T40D11M30I2R0/src/I2c_Ip_Irq.c.o
"c:\nxp\sw32g_rtd_4.4_3.0.2_hf01\eclipse\plugins\i2c_ts_t40d11m30i2r0\include\I2c_Ip_Irq.h", line 135: error #40:
expected an identifier
void I2c_Ip_IRQHandler1(void);
my driver stack is (in Tresos) configured to by of OsifOperatingSystemType = OsifAutosarOsType, and that determines the content of the ISR() macro.
I am aware that I2C is not (yet) specified by AUTOSAR, but it should not be a problem to use the I2C driver of the RTD stack
and call it from some custom integration code or an AUTOSAR CDD.
In my humble opinion, the root cause for the compiler error is the following:
in the file C:\NXP\SW32G_RTD_4.4_3.0.2_HF01\eclipse\plugins\I2c_TS_T40D11M30I2R0\src\I2c_Ip_Irq.c,
the function names are correctly wrapped in the ISR() macro:
#define I2C_START_SEC_CODE
#include "I2c_MemMap.h"
#if (I2C_INSTANCE_COUNT >= 1U)
ISR(I2c_Ip_IRQHandler0)
{
/* Call interrupt handler instance 0 */
I2c_Ip_ModuleIRQHandler(0u);
}
#endif
while in the corresponding header file C:\NXP\SW32G_RTD_4.4_3.0.2_HF01\eclipse\plugins\I2c_TS_T40D11M30I2R0\include\I2c_Ip_Irq.h, this macro is missing:
#define I2C_START_SEC_CODE
#include "I2c_MemMap.h"
#if (I2C_INSTANCE_COUNT >= 1U)
void I2c_Ip_IRQHandler0(void);
#endif
putting the ISR() macro manually around the function prototypes for the Irq handlers solves the problem
#if (I2C_INSTANCE_COUNT >= 1U)
ISR(I2c_Ip_IRQHandler0);
//void I2c_Ip_IRQHandler0(void);
#endif
This is also how it is done in all other modules of the RDT package.
But that means I am patching static NXP code. I am currently of the opinion that this is a software bug in a module that is possibly rarley used in conjunction with classic AUTOSAR stacks (but it should work anyway). I have checked later RTD versions for the S32G2, the code looks the same.
Can anyone from NXP please confirm (or object), and if confirmed: feed this into the development pipeline for fixing ?
thanks and best regards,
Stefam
target SoC: S32G274A
target board: NXP S32G-VNP-RDB2
project environment: classic AUTOSAR
Real time Drivers: NXP SW32G_RTD_4.4_3.0.2_HF01 (and later versions)