Skip to main content
Associate II
June 29, 2023
Solved

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

  • June 29, 2023
  • 2 replies
  • 2677 views

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

 

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

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

2 replies

Associate II
June 29, 2023

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
Foued_KHBest answer
ST Employee
July 3, 2023

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.