cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure slave to enter and exit HDR mode through I3C on stm32h503

taylor_quan
Associate II

I am using the following slave device for I3C reading and writing. I can now read and write CMOS registers through private mode, but I cannot find any examples of entering and exiting HDR mode. Can you provide an example program for entering and exiting HDR mode? Thanks

taylor_quan_0-1688024800679.png

taylor_quan_1-1688024829575.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

Hello @taylor_quan , 

- HDR exit pattern generation on the I3C bus for error recovery.
You can enable the HDR exit via the I3C_CFGR register : [ Bit 4 EXITPTRN: HDR exit pattern enable (when I3C acts as a controller) ]

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
taylor_quan
Associate II

Another issue is that I cannot cancel the reserved byte when using private read

taylor_quan_1-1688026135340.png

I3C_PrivateTypeDef aPrivateDescriptor[3] = \
                                          {
                                            {TARGET1_DYN_ADDR, {aTxBuffer, 2}, {NULL, 0}, HAL_I3C_DIRECTION_WRITE},
                                            {TARGET1_DYN_ADDR, {NULL, 0}, {aRxBuffer, 30}, HAL_I3C_DIRECTION_READ},
											{TARGET1_DYN_ADDR, {aTxBuffer, 2}, {aRxBuffer, 30}, HAL_I3C_DIRECTION_BOTH}
                                          };

    /*##- 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_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(&hi3c1, &aContextBuffers[0],100) != HAL_OK)
    {
      /* Error_Handler() function is called when error occurs. */
      Error_Handler();
    }

    while (HAL_I3C_GetState(&hi3c1) != HAL_I3C_STATE_READY)
    {
    }

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

 

 

Foued_KH
ST Employee

Hello @taylor_quan , 

- HDR exit pattern generation on the I3C bus for error recovery.
You can enable the HDR exit via the I3C_CFGR register : [ Bit 4 EXITPTRN: HDR exit pattern enable (when I3C acts as a controller) ]

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.