Skip to main content
Explorer
July 21, 2024
Solved

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

  • July 21, 2024
  • 1 reply
  • 1708 views

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();
}

 

 

 

 

 

 

 

    This topic has been closed for replies.
    Best answer by Foued_KH

    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

    1 reply

    Foued_KHAnswer
    ST Employee
    July 30, 2024

    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

    LEE_SEAuthor
    Explorer
    August 1, 2024

    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