MIMXRT685 I3C Sample Code have OREAD(Over Read Error) Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MIMXRT685 I3C Sample Code have OREAD(Over Read Error) Problem

1,685 Views
Andy_Sun
Contributor I

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-------------------------------------------------------

0 Kudos
Reply
3 Replies

1,669 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

I was able to replicate the behavior that you mentioned. I'm checking this internally, I will provide you an update as soon as possible. 

Regards,
Victor 

0 Kudos
Reply

1,646 Views
Andy_Sun
Contributor I

Hi Victor,

Thank you for your willingness to assist me,

Is there a new version update?

 

0 Kudos
Reply

1,618 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

The MERRWARN.OREAD gets set when single-stepping through the code with the RxFIFO already empty (as is the case when initializing the IP after a reset). With the debugger updating the peripheral view with every step made thru the driver code, sooner or later the Rx FIFO will get empty and the OREAD will get set.

This can be avoided if the debugger does not read the RxFIFO when updating the peripheral register view but the end-user doesn't have that level of control on the tool. As a workaround, you can close the I3C peripheral view, during the initialization. If you run the application normally, you will see that the OREAD doesn't turn on during the initialization. 

Regards,
Victor 

 

0 Kudos
Reply