Hi All,
IDE:Keil MDK
SDK:SDK_2.9.0_EVK-MIMXRT685
Board:MIMXRT685-EVK
Sample Code: driver example->i3c->i3c_polling_b2b_transfer_master
Problem:
OREAD bit in the MERRWARN register remains high when I execute I3C_MasterInit().I found that the problem lies in RESET_PeripheralReset(kI3cResets[instance]) in I3C_MasterInit(),When PeripheralReset is executed, the OREAD Bit will remain high and cannot directly clear the OREAD Bit,This will cause I3C to fail to transmit data due to detection OREAD errors .
May I ask if I have overlooked something that caused this problem?
-----------------------------------Test Code-------------------------------------------------------
int main(void)
{
i3c_master_config_t masterConfig;
i3c_master_transfer_t masterXfer;
status_t result = kStatus_Success;
/* Attach main clock to I3C, 396MHz / 4 = 99MHz. */
CLOCK_AttachClk(kMAIN_CLK_to_I3C_CLK);
CLOCK_SetClkDiv(kCLOCK_DivI3cClk, 4);
BOARD_InitBootPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
PRINTF("\r\nI3C board2board polling example -- Master transfer.\r\n");
/* I3C mode: Set up i3c master to work in I3C mode, send data to slave*/
/* First data in txBuff is data length of the transmitting data. */
g_master_txBuff[0] = I3C_DATA_LENGTH - 1U;
for (uint32_t i = 1U; i < I3C_DATA_LENGTH; i++)
{
g_master_txBuff[i] = i - 1;
}
PRINTF("\r\nStart to do I3C master transfer in I2C mode.\r\n");
PRINTF("Master will send data :");
for (uint32_t i = 0U; i < I3C_DATA_LENGTH - 1U; i++)
{
if (i % 8 == 0)
{
PRINTF("\r\n");
}
PRINTF("0x%2x ", g_master_txBuff[i + 1]);
}
PRINTF("\r\n\r\n");
I3C_MasterGetDefaultConfig(&masterConfig);
masterConfig.baudRate_Hz.i2cBaud = EXAMPLE_I2C_BAUDRATE;
masterConfig.baudRate_Hz.i3cPushPullBaud = 3900000U;
masterConfig.baudRate_Hz.i3cOpenDrainBaud = 500000U;
masterConfig.enableOpenDrainStop = false;
I3C_MasterInit(EXAMPLE_MASTER, &masterConfig, I3C_MASTER_CLOCK_FREQUENCY);
EXAMPLE_MASTER->MERRWARN = 0x0;
while(1);
}
-----------------------------------Test Code-------------------------------------------------------