Skip to main content
Visitor II
April 23, 2024
Question

SETAASA command I3C

  • April 23, 2024
  • 2 replies
  • 1909 views

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!

    This topic has been closed for replies.

    2 replies

    ST Employee
    April 23, 2024

    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 

    Visitor II
    January 28, 2025

    Hi @kvganesh ,

    I've modified your code in the places that I think you had errors:

    #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,0},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,
     aSET_AASA,
     NULL,
     aContextBuffers,
     1,
     I3C_BROADCAST_WITHOUT_DEFBYTE_RESTART) != HAL_OK)
     {
     Error_Handler();
     }
     
     if (HAL_I3C_Ctrl_TransmitCCC(&hi3c1, aContextBuffers, 1000) != HAL_OK)
     {
     Error_Handler();
     }