conflicting types for 'I2C001_ReadData' error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
what can i do when i have this error in I2C001.c for this code
"bool I2C001_ReadData(const I2C001Handle_type* I2CHandle, uint16_t* buffer)
{
bool Result = (bool)FALSE;
USIC_CH_TypeDef* I2CRegs = I2CHandle->I2CRegs;

/* <<>>*/
if(USIC_ubIsRxFIFOempty(I2CRegs))
{
Result = (bool)FALSE;
}
else
{
*buffer = (uint8_t)I2CRegs->OUTR;
Result = (bool)TRUE;
}

return Result;
}"
Knowing that this function is declareted in the file header I2C001.h
what Can i do ??
please help me
thanks
0 Likes
8 Replies
Not applicable
Hi randa,

Are you using latest I2C001[1.0.28] in DAVE v3.1.10 ? Does the error appear when there is only one I2C001 App in the DAVE project?

Best regards,
Sophia
0 Likes
Christian1
Employee
Employee
I'm experiencing the same issue.

As a quick workaround, comment out the declarations in the corresponding header file (./Dave/Generated/inc/I2C001/I2C001.h). Of course, after each code generation, this step must be repeated.

Not really a solution, but I haven't found time to understand this problem in more detail yet.
0 Likes
Not applicable
Hi both,

I'm unable to reproduce your problem. Would you pls provide some more details on your project (eg. DAVE version, Apps versions etc.) and the snapshot of the error you encountered?

Best regards,
Sophia
0 Likes
Christian1
Employee
Employee
In my case the project consists of

  • GUISL001 [1.0.22]
  • I2C001 [1.0.28]
  • USBD_VCOM [1.0.0]


I'm using DAVE 3.1.10.

1520.attach
0 Likes
Not applicable
Hello,
I have the same problem with DAVE3.1.10 using
1. ETH001[1.0.22]
2. I2C001[1.0.28]

Workaround: set bool to unsigned char
-> unsigned char I2C001_ReadData(const I2C001Handle_type* I2CHandle, uint16_t* buffer)
-> unsigned char I2C001_WriteData(const I2C001Handle_type* I2CHandle,const I2C001_DataType* Data)
0 Likes
Not applicable
Hi Christian,

The root cause for your case is:
In USBD_VCOM app, xmc4_common.h includes stdbool.h and types.h file defines ‘ unsigned char’ as bool.

#if (!defined(__cplusplus) && !defined(_STDBOOL_H))
typedef unsigned char bool;
#endif

Temporarily you can include the stdbool.h in the types.h file to solve the conflict. At the same time, remove the above condition to avoid error when work with non GCC compilers.

@all,
Pls follow up with the eTicket131766738 for the final solution.

Best regards,
Sophia
0 Likes
Christian1
Employee
Employee
Thank you for looking into this!
0 Likes
Not applicable
stanjola wrote:
Hello,
I have the same problem with DAVE3.1.10 using
1. ETH001[1.0.22]
2. I2C001[1.0.28]

Workaround: set bool to unsigned char
-> unsigned char I2C001_ReadData(const I2C001Handle_type* I2CHandle, uint16_t* buffer)
-> unsigned char I2C001_WriteData(const I2C001Handle_type* I2CHandle,const I2C001_DataType* Data)


Thanks this helped me out!
0 Likes