It looks like there is a bug in the I2C2 code generated by HalCoGen for Hercules RM57L843ZWT.
The I2C2 interrupt handler, if enabled, handles the TX ready interrupt by writing data to the I2C1 DXR register. I found the source of the issue in the following file:
C:\ti\Hercules\HALCoGen\v04.05.02\drivers\TMS570LC435ZWT\I2C570v000\i2c.c
line 984 in the I2C2 interrupt handler is:
i2cREG1->DXR = (uint32)*g_i2cTransfer_t[1U].data;
This is obviously incorrect.
Details:
- HALCoGen 04.05.02
- Target: RM57L843ZWT_FREERTOS
- I2C2 is enabled
- I2C2 interrupt is enabled