FreeRTOS I2C Implementation/Interrupts

I’m trying to get an I2C bus operating on an iMx8 M7.

The M7 is running freeRTOS (8-9 Tasks).

I can’t seem to get an interrupt to fire for an I2C Transaction with the M7 being a master.

I’ve had similar issues related to two SPI ports I am using.

I had thought that moving the interrupt priority to be outside of the RTOS aware range fixed it…maybe not.

So my question is really two…can anyone provide help in I2C ussage with freeRTOS.

Also can anyone elaborate on the use of peripheral interrupts not associated with the RTOS.

Here’s a great reference for interrupts not associated with the RTOS on Cortex M.

Recent versions of FreeRTOS verify that interrupt priorities follow the plan prescribed in the above link. Be sure your project defines configASSERT() so you can benefit from these checks.

If an interrupt won’t fire on CM7, here are some possible explanations:

  • Interrupts are masked via BASEPRI
  • The interrupt is not enabled in the interrupt controller (NVIC)
  • The interrupt is not enabled inside the peripheral
  • The conditions required by the peripheral to raise the interrupt are not present

For questions related to I2C on your i.MX, you may try NXP’s support forum.

1 Like