I recently needed to convert the blocking use of I2C (IOM5) on the project I have. The issue I am facing is the ISR for IOM5 is never called even though the transfer is being completed and the interrupt status flags appear to be set in IOM5 interrupt status register.
Interrupts are being enabled in “am_hal_iom_nonblocking_transfer”, my ISR looks like this:
void am_iomaster5_isr(void)
{
uint64_t ui64Status;
traceISR_ENTER();
am_hal_iom_status_get(&g_I2C5Handle, &ui64Status);
am_hal_iom_interrupt_clear(&g_I2C5Handle, ui64Status);
am_hal_iom_interrupt_service(g_I2C5Handle, ui64Status);
traceISR_EXIT();
}
IOM5 is configured:
static am_hal_iom_config_t g_sIOMI5cConfig =
{
.eInterfaceMode = AM_HAL_IOM_I2C_MODE,
.ui32ClockFreq = AM_HAL_IOM_400KHZ,
.pNBTxnBuf = i2c5OutputBuffer,
.ui32NBTxnBufLength = sizeof(i2c5OutputBuffer)/4,
};
Interrupt priority is set and IOM5 is enabled:
//
// Initialize IOM 5.
//
am_hal_iom_initialize(iomModule, &g_I2C5Handle);
am_hal_iom_power_ctrl(g_I2C5Handle, AM_HAL_SYSCTRL_WAKE, false);
//
// Set the required configuration settings for the IOM.
//
am_hal_iom_configure(g_I2C5Handle, &g_sIOMI5cConfig);
//
// Configure the IOM pins.
//
am_bsp_iom_pins_enable(iomModule, AM_HAL_IOM_I2C_MODE);
//
// Set the IOM Interrupt priority
//
NVIC_SetPriority(IOMSTR5_IRQn, I2C_5_INTERRUPT_PRIORITY);
//
// Enable the IOM.
//
am_hal_iom_enable(g_I2C5Handle);
I am at a bit of a loss as to what could be wrong.
Sid