I2C Error config_parser.c

Hello,

In the process of development, I have come across the following error while debugging my application on a Colibri Dev-kit:

I2C Error: .\src\config_parser.c, 401: Context Corruption
CMApplication.exe has triggered a breakpoint

The call stack shows the following:

Library.dll!LibMsg(unsigned long type, char * libName, char * fileName, unsigned long lineNr, char * fmtStr, ...) Line 42
Library.dll!CfgPrs_GetHandle(void * hPort, const char * LibName) Line 402
Library.dll!Imx6I2c_SetConfigInt(void * hPort, const wchar_t * paramName, unsigned long value, ParamStorageType storageType) Line 187
Library.dll!I2c_SetConfigInt(void * hPort, const wchar_t * paramName, unsigned long value, ParamStorageType storageType) Line 235

Can you provide any guidance as to what this might indicate? The code which calls I2cSetConfigInt is called multiple times before it triggers this error. I do initialize other peripherals in my code (SPI) - could this be related?

Thanks,

Aaron

Are you initializing I2C directly? Or you use PWM?
If you can do step-by-step debugging and find what *_Init or *_Open function call generates the issue that would help.

I am initiliaizing I2C using I2c_Init, followed by configuration of the SDA and SCL lines, and then call I2c_Open. This failure occurs after all initialization and configuration during an I2c_SetConfigInt call. If I comment out the I2c_SetConfigInt call and make a call to I2c_Write, I get the same error. The odd thing is that my code was working on library version 1.5, and upgrading to 2.1 introduced this issue.

I should also mention that I have peripherals on the following buses:
CAN1:
RX 63
TX 55
I2C1
SCL 196
SDA 194
I2C4
SCL 162
SDA 154
SPI1
CLK 153
MOSI 155
MISO 157
SPI2
CLK 88
MOSI 92
MISO 90

Can you post a code snippet that can be used to reproduce the issue? Or upload it to share.toradex.com?
Does this happen on I2C1 or I2C4?

I have the same symptom using the I2C library in kernel mode drivers. I uploaded a small sample application that illustrates the problem.
https://share.toradex.com/rpzio11190j36ry

@aaron.h,

We are unable to reproduce the issue with our library release demo applications. Could you please share a code snippet through share.toradex.com and post a link here.

Hi aaron.h,

Thank you for reporting this issue and your patience. We have implemented a quick fix to solve this problem and would you like share with preliminary release to continue your development. Please download it from here and let us know your feedback if you have seen any issue on this.

We are looking into implementing another good solution that will take approximately 2 weeks, let you know the update as soon as done.

Hi @raja.tx,

Thank you for this fix. This did in fact resolve the issue. I will let you know if other peripherals were negatively affected by this release.

Thanks!