# FreeRTOS I2C Implementation/Interrupts

**URL:** <https://forums.freertos.org/t/freertos-i2c-implementation-interrupts/18434>\
**Category:** Kernel\
**Created:** [October 31, 2023, 5:29pm UTC](https://forums.freertos.org/t/freertos-i2c-implementation-interrupts/18434 "2023-10-31T17:29:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rantonetti](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@rantonetti](https://forums.freertos.org/u/rantonetti)\
**Post date:** [October 31, 2023, 5:29pm UTC](https://forums.freertos.org/t/freertos-i2c-implementation-interrupts/18434/1 "2023-10-31T17:29:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jefftenney](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/jefftenney/32/1314_2.png) [@jefftenney](https://forums.freertos.org/u/jefftenney)\
**Post date:** [October 31, 2023, 9:44pm UTC](https://forums.freertos.org/t/freertos-i2c-implementation-interrupts/18434/2 "2023-10-31T21:44:41Z")

</div>

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

> **[RTOS for ARM Cortex-M](https://www.freertos.org/RTOS-Cortex-M3-M4.html)**
>
> Setting RTOS interrupt priorities on a ARM Cortex-M microcontroller

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.
