cancel
Showing results for 
Search instead for 
Did you mean: 

I want insert I3C repeated start bit Not Stop Bit in I3C Private 1 byte Read at Stm32H503RB

LEE_SE
Associate

Hi , 

 

I tested  example " I3C_Controller_Private_Command_IT "  with  Controller  H503RB board 

and  modified for JEDEC SMBUS for DDR5  

( JEDEC smbus is more simple than MIPI I3C ,

No  DynAddrAssign function ,  Initially  I2C   after  CCC SetAASA ,  it change  I2C ==>  I3C ) 

 

1.  CCC SetAASA   is OK ,   When I  read   register address 0x1  with I3C  1byte private read ,   I3C read value is  not   what i want .  Read value is  pointing   register  address  0x0 value and  fixed .  I think  there is a stop bit  in  Read protocol  and  after Stop bit , Internal read pointer in my chip is cleared 

example an5879,  9.8 Private Read code ,  also  Stop Bit  in  I3C private Read  command 

 

* It is JEDEC I3C Specification  ,  repeated start bit  , No Stop Bit  in  Read  Command

 

LEE_SE_2-1721573784343.png

* example 9.8  code 

LEE_SE_3-1721574206107.png

 

2.  I  tried to change it when TX frame setting ,    but   Not cleared 

 I3C_PRIVATE_WITH_ARB_STOP ==> I3C_PRIVATE_WITH_ARB_RESTART ,   MEND=0

 

Can  u tell me  how to do it ? 

Thanks 

 

 

* My test Code  for CCC SetAASA 

/* Enable arbitration header */
LL_I3C_EnableArbitrationHeader(hi3c->Instance);

/* Write CCC information in the control register */
LL_I3C_ControllerHandleCCC(hi3c->Instance, I3C_BROADCAST_AASA_0x29, 0U, LL_I3C_GENERATE_STOP);

 HAL_Delay(100);

 LL_I3C_DisableArbitrationHeader(hi3c->Instance);

 HAL_Delay(100);

 

/*##- Add context buffer transmit in Frame context #####################*/
if (HAL_I3C_AddDescToFrame(&hi3c1,
NULL,
&aPrivateDescriptor[I3C_IDX_FRAME_1],
&aContextBuffers[I3C_IDX_FRAME_1],
aContextBuffers[I3C_IDX_FRAME_1].CtrlBuf.Size,
I3C_PRIVATE_WITH_ARB_STOP  ==>I3C_PRIVATE_WITH_ARB_RESTART ) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}

/*##- Start the transmission process ###################################*/
/* Transmit private data processus */
if (HAL_I3C_Ctrl_Transmit_IT(&hi3c1, &aContextBuffers[I3C_IDX_FRAME_1]) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}

 

if (HAL_I3C_AddDescToFrame(&hi3c1,
NULL,
&aPrivateDescriptor[I3C_IDX_FRAME_2],
&aContextBuffers[I3C_IDX_FRAME_2],
aContextBuffers[I3C_IDX_FRAME_2].CtrlBuf.Size,
I3C_PRIVATE_WITH_ARB_STOP) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}

/* Wait for USER push-button press before starting the Communication */
while (BSP_PB_GetState(BUTTON_USER) != GPIO_PIN_RESET)
{
}

/* Wait for USER push-button release before starting the Communication */
while (BSP_PB_GetState(BUTTON_USER) != GPIO_PIN_SET)
{
}

/*##- Start the reception process ######################################*/
/* Receive private data processus */
if (HAL_I3C_Ctrl_Receive_IT(&hi3c1, &aContextBuffers[I3C_IDX_FRAME_2]) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @LEE_SE , 

To handle I3C as Controller data buffer transmission/reception, you can use HAL_I3C_Ctrl_MultipleTransfer_IT() function.
This mean that the HAL_I3C_Ctrl_MultipleTransfer_IT() function allow the I3C Controller to send a transmission buffer which contain the register address of the data, and to retrieve and fill the data into reception buffer.
This function is similar to HAL_I2C_Mem_Read/HAL_I2C_Mem_Write.

Let me know if this helps you!
Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Foued_KH
ST Employee

Hello @LEE_SE , 

To handle I3C as Controller data buffer transmission/reception, you can use HAL_I3C_Ctrl_MultipleTransfer_IT() function.
This mean that the HAL_I3C_Ctrl_MultipleTransfer_IT() function allow the I3C Controller to send a transmission buffer which contain the register address of the data, and to retrieve and fill the data into reception buffer.
This function is similar to HAL_I2C_Mem_Read/HAL_I2C_Mem_Write.

Let me know if this helps you!
Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi 

I  reviewd  example " I3C Sensor Private Command IT "   and using  HAL_I3C_Ctrl_MultipleTransfer_IT(); 

its  OK.   Repeated start bit  in   I3C Read  Command  and  it works well

thanks