I connected the IMU with the RT685.
I initialized the MCU and RT685 successfully. I could see the RT685 assign the dynamic address (0x27)to the IMU from logic analyzer.
But the Controller rt685 couldn't get the IBI request.
I check the code, the value of I3C->MSTATUS is wrong. the value is 0x1000.
Could you explain the meaning of the error value?
How to revise the code?
Could you offer the informations about the registers about I3C ?
/* Check for IBI */
int i3c_check_for_ibi(void)
{
mstatusVal = I3C->MSTATUS;
return !(((mstatusVal & I3C_MSTATUS_NACKED_MASK) == I3C_MSTATUS_NACKED(1)) ||
((mstatusVal & I3C_MSTATUS_IBITYPE_MASK) != I3C_MSTATUS_IBITYPE(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)));
}
Hello
Hope you are well.
Every I3C slave device must have a read-only Bus Characterization Register (BCR) and a Device Characterization Register (DCR). These registers information can be read using one of the CCC commands. Not every I3C slave device can support IBI though, bit 1 of the BCR register indicates whether IBI request is capable or not.
Did you set MIBIRULES register? You can do it with I3C_MasterRegisterIBI().
You can find more detailed information of the registers in the RT600 User Manual.
0x1000 value from MSTATUS is the default value for this register, please check chapter 26.6.26 from the User Manual.
If you have more questions do not hesitate to ask me.
Best regards,
Omar
hello @Omar_Anguiano
I ckeck the documents you mentioned. now I know 0x1000 is default value.
Q1:But the value represents the state of the I3C bus. if the registers keep this value unchanged. What does this mean? Is the sonsor not generating an interrupt?or is there something wrong with the MCU?
Q2:this value of register should change automatically with the state of the bus. if that makes sense?
Q3:How should I solve this problem?(the MSTATUS holds the 0x1000 unchanged.)
Thanks
The value means that the bus is idle and the interruption wasn't generated. If it was generated it might be cleared before accessing the register so I suggest you read individually the field when IBI is generated(IBIWON).
Since it is a status register it should change as the module is working.
Did you set MIBIRULES register? Please also make sure that interruptions are enabled through NVIC.
If you have more questions do not hesitate to ask me.
Best regards,
Omar
I read the value of the MIBIRULES is 0,
that means my dynamic address is not right?
Yes, it means that the register is not set.
MIBIRULES Contains the rules for using In-band Interrupts and keeps a registry of the slaves who use the IBI byte. Concerning ADDRn fields: The address is 6 bits, and assuming that IBIRULES.MSB0=1, then each address has its most significant bit = 0. This means that each address is 7 bits (usually written as A7 to A1), and the A7 must be 0. If the application does not use that optimal convention, then the Manual method of IBI ACK handling must be used (see MCTRL).
• The default is that the ADDRn values indicate the slaves with a mandatory byte.
• If MIBIRULES.NOBYTE is set, then the ADDRn values indicate slaves that do not have a mandatory IBI byte.
If you have more questions do not hesitate to ask me.
Best regards,
Omar
Hi Omar,
Thanks for your reply
I just find the document of i.MX RT685 Evaluation Board User Manual.
I can't find the document you mentioned RT600 User Manual.
Could you tell me how to get it?