cancel
Showing results for 
Search instead for 
Did you mean: 

SETAASA command I3C

kvganesh
Associate

Hello!
I have an i3c target device which has a static address, datasheet says I need to send SETAASA command to start communicating with the device.

I tried doing,

 

#define SETAASA 0x29
#define STATIC_ADRESS   0x47
I3C_CCCTypeDef aSET_AASA=
{
    /*Target Addr CCC Value CCC data + defbyte pointer  CCC size + defbyte Direction        */
    {STATIC_ADRESS,SETAASA,{NULL,1},HAL_I3C_DIRECTION_WRITE},
};
/* USER CODE BEGIN 2 */

/* Send a DISEC to disable IBI interrupt */
  aContextBuffers[I3C_IDX_FRAME_1].CtrlBuf.pBuffer = aControlBuffer;
  aContextBuffers[I3C_IDX_FRAME_1].CtrlBuf.Size    = 1;
  aContextBuffers[I3C_IDX_FRAME_1].TxBuf.pBuffer   = aTxBuffer;
  aContextBuffers[I3C_IDX_FRAME_1].TxBuf.Size      = 1;
  
  /* Add context buffer Set CCC frame in Frame context */
  if (HAL_I3C_AddDescToFrame(&hi3c1,
                             SETAASA,
                             NULL,
                             aContextBuffers,
                             1,
                             I3C_BROADCAST_WITHOUT_DEFBYTE_RESTART) != HAL_OK)
  {
    Error_Handler();
  }
  
  if (HAL_I3C_Ctrl_TransmitCCC(&hi3c1, aContextBuffers, 1000) != HAL_OK)
  {
    Error_Handler();
  }

 Any help would be appreciated 

Thank you!

1 REPLY 1
Foued_KH
ST Employee

Hello @kvganesh;, 

The Primary Controller should assign Dynamic Addresses to any I3C Devices with a known Static Address, using the Command Code Set Dynamic Address from Static Address (SETDASA), or by assigning all I3C Devices their known I2C Static Address using the Command Code Set All Addresses to Static Address(SETAASA).

In your case you need to send a SETAASA to start the communication with the target. Then you can start the transfer ( read or write ) with the I3C target.

Check if your target supports ENTDAA .

Let me know!
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.