Reputation: 11
I am communicating with the TDK's ICM-45686 sensor from a STM32H5 microcontroller through I3C however cannot seem to get I3C's In-band Interrupt (IBI) to work with the sensor. The datasheet explicitly states that "ICM-45686 includes In-band Interrupt (IBI) support for the I3CSM interface" (https://invensense.tdk.com/wp-content/uploads/documentation/DS-000577_ICM-45686.pdf section 7) however lacks documentation as to how to enable IBI using its config registers unlike TDK's older generation ICM-42688 and ST's LSM6DSV16X sensor (sensor used in the microcontroller's official I3C IBI example (https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H533RE/Examples/I3C/I3C_Controller_Sensor_IBI) which explicitly explain how to enable IBI on the sensor. My thinking currently is that IBI will be automatically enabled by just normally configuring the interrupts (by configuring the INTX_CONFIGX registers) but I'm not getting any interrupts from the sensor even though I've enabled IBI notification callback on the controller side and also enabled IBI on the sensor side through CCCs (following the stm github example I linked prev), and I'm confident of this because when I read the getstatus CCC it is 0x05 which means IBI is working and also the defaults state turns from HAL_I3C_STATE_READY to HAL_I3C_STATE_LISTEN.
// IBI callback
void HAL_I3C_NotifyCallback(I3C_HandleTypeDef *hi3c, uint32_t notifyId)
{ //not getting called }
/*##- Enable IBI interrupt #####################################################*/
aContextBuffers[I3C_IDX_FRAME_TX].CtrlBuf.pBuffer = aControlBuffer;
aContextBuffers[I3C_IDX_FRAME_TX].CtrlBuf.Size = COUNTOF(aControlBuffer);
aContextBuffers[I3C_IDX_FRAME_TX].TxBuf.pBuffer = aTxBuffer;
aContextBuffers[I3C_IDX_FRAME_TX].TxBuf.Size = 1;
aContextBuffers[I3C_IDX_FRAME_TX].RxBuf.pBuffer = aRxBuffer;
aContextBuffers[I3C_IDX_FRAME_TX].RxBuf.Size = 1;
/*##- Add context buffer Set CCC frame in Frame context ###########################*/
if (HAL_I3C_AddDescToFrame(&hi3c1,
aDirect_ENEC_GETBCR_CCC,
NULL,
&aContextBuffers[I3C_IDX_FRAME_TX],
COUNTOF(aDirect_ENEC_GETBCR_CCC),
I3C_DIRECT_WITHOUT_DEFBYTE_STOP) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}
/* Multiple transfer private data processus */
if (HAL_I3C_Ctrl_MultipleTransfer_IT(&hi3c1, &aContextBuffers[I3C_IDX_FRAME_TX]) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}
while (HAL_I3C_GetState(&hi3c1) != HAL_I3C_STATE_READY)
{
}
/* Now modify a DEVR1, to autorized IBI acknowledgement */
I3C_DeviceConfTypeDef DeviceConf[1] = {0};
DeviceConf[0].DeviceIndex = DEVICE_ID1;
DeviceConf[0].TargetDynamicAddr = TARGET1_DYN_ADDR;
DeviceConf[0].IBIAck = __HAL_I3C_GET_IBI_CAPABLE(aRxBuffer[0]);
DeviceConf[0].IBIPayload = __HAL_I3C_GET_IBI_PAYLOAD(aRxBuffer[0]);
DeviceConf[0].CtrlRoleReqAck = __HAL_I3C_GET_CR_CAPABLE(aRxBuffer[0]);
DeviceConf[0].CtrlStopTransfer = DISABLE;
if (HAL_I3C_Ctrl_ConfigBusDevices(&hi3c1, &DeviceConf[0], 1U) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}
/* Activate notification for IBI event */
if (HAL_I3C_ActivateNotification(&hi3c1, NULL, HAL_I3C_IT_IBIIE) != HAL_OK)
{
/* Error_Handler() function is called when error occurs. */
Error_Handler();
}
I've already reached out to TDK but they never respond, any help or suggestions would be greatly appreciated. Thanks in advance.
Upvotes: 0
Views: 20