RT685 I3C IBI/ENTDAA example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT685 I3C IBI/ENTDAA example

2,127 Views
hichen_invn
Contributor II

Hi...

I am using RT685 to interact with my IMU device in I3C. I see there is an example in this link and is able to use it now. https://community.nxp.com/t5/i-MX-RT/NXP-MIMXRT685-EVK-i-MX-RT600-SDK-2-8-2-control-ST-LSMDSOX-by/m-...

 

However, I am looking for IBI support and ENTDAA process, which the example project doesn't have it. Could you provide example for me? Thanks.

0 Kudos
Reply
6 Replies

2,119 Views
fangfang
NXP TechSupport
NXP TechSupport

Hello,

Unfortunately, there is no more code for it. Sorry for the inconvenience may cause.

Have a nice day.

 

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos
Reply

2,107 Views
hichen_invn
Contributor II

Hi...

Could you consider assigning resource for this matter? It is an important feature of my project and could be same for NXP as new example project.

Thanks.

0 Kudos
Reply

2,036 Views
daniel_kirubakaran
Contributor I
Spoiler
Hi ,

Have you got the solution for the IBI example query?

I want the same information for my project as well. I am using LSM6DSOX, i dont know how to start using IBI mechanism.





thanks




0 Kudos
Reply

2,024 Views
hichen_invn
Contributor II

Hi Daniel,

No I didn't get support from NXP.

Here is my own implementation for your reference, works on my IMU, not sure if works on LSM. You may also want to cross reference AN12796 from this link.

 
typedef struct {
    uint8_t da;  // dynamic address of IBI winner
    uint8_t pl;  // payload of IBI winner
} ibi_data_t;
 
static uint32_t mctrlVal;
 
/* Wait for IBI */
int i3c_wait_ibi(ibi_data_t* ibi_data)
{
    /* clear flags */
    i3c_ccc_errwarn_status_clear();

    /* wait in AUTOIBI request and ack with mandatory byte */
    mctrlVal = I3C->MCTRL;
    mctrlVal &= ~(I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_IBIRESP_MASK);
    mctrlVal |= I3C_MCTRL_REQUEST(kI3C_RequestAutoIbi) | I3C_MCTRL_IBIRESP(kI3C_IbiRespAckMandatory);
    I3C->MCTRL = mctrlVal;

    /* wait acked, ibitype=1 (IBI), slvstart = mctrldone = complete = ibiwon = 1 */
    do {
        mstatusVal = I3C->MSTATUS;
    } while (((mstatusVal & I3C_MSTATUS_NACKED_MASK) == I3C_MSTATUS_NACKED(1)) || ((mstatusVal & I3C_MSTATUS_IBITYPE_MASK) != I3C_MSTATUS_IBITYPE(1)) || ((mstatusVal & I3C_MSTATUS_SLVSTART_MASK) != I3C_MSTATUS_SLVSTART(1)) ||
             ((mstatusVal & I3C_MSTATUS_MCTRLDONE_MASK) != I3C_MSTATUS_MCTRLDONE(1)) || ((mstatusVal & I3C_MSTATUS_COMPLETE_MASK) != I3C_MSTATUS_COMPLETE(1)) || ((mstatusVal & I3C_MSTATUS_IBIWON_MASK) != I3C_MSTATUS_IBIWON(1)));
 
    ibi_data->da = (uint8_t)((I3C->MSTATUS & I3C_MSTATUS_IBIADDR_MASK) >> I3C_MSTATUS_IBIADDR_SHIFT);

    /* emit request Stop, nack IBI */
    mctrlVal = I3C->MCTRL;
    mctrlVal &= ~(I3C_MCTRL_TYPE_MASK | I3C_MCTRL_REQUEST_MASK | I3C_MCTRL_IBIRESP_MASK);
    mctrlVal |= I3C_MCTRL_TYPE(kI3C_TypeI3CSdr) | I3C_MCTRL_REQUEST(kI3C_RequestEmitStop) | I3C_MCTRL_IBIRESP(kI3C_IbiRespNack);
    I3C->MCTRL = mctrlVal;

    /* copy IBI data */
    ibi_data->pl = (uint8_t)I3C->MRDATAB;

    return 0;
}

1,892 Views
dave_42
Contributor I

Hi Hichen,

 

thanks for your well working code.

I have a question though: i have tried to "cancel" the IBI reception in the loop (e.g. because no IBI came and I want to do something different). Seems however like once kI3C_RequestAutoIbi in MCTRL, there is no way to do something else on the bus than receiving an IBI.

 

Have you maybe tried/experienced the same?

Cheers, David

0 Kudos
Reply

2,017 Views
daniel_kirubakaran
Contributor I

Thanks for your reply hichen,

 

well what is the IMU that you are using?( i am using LSM6DSOX)

and have you encountered getting mandatory bytes while reading data?

 

could you please instruct me the programming sequence or algorithm for getting data using IBI ?

I am not using NXP board , i am working with other FPGA board that has i3c driver.

So a common logic for performing IBI operation is required.

i have the data sheet of lsm6dsox , and in the BCR register, bit [ 2 ]is set to 1 hence it will send the mandatory byte, the datasheet doesn't tells about mandatory data, got to know through i3c specification.

 

Thanks

 

 

0 Kudos
Reply