This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using I2C with two devices on App Timer gets Hardfault

Hello,

I have two devices sharing an I2C bus. These devices are the MAX86150 and the MLX90614. DMA is being used. I2C is running at 100 KHz.

After initializing both devices, the application timer is configured to interrupt every 10 ms. A process function for each device executes every 100 ms based upon this time. Basically, every 100 ms various registers within each device are read and these values are updated within data structures in RAM. The devices are read back-to-back, first the MLX and then the MAX; there is no delay between the reading of these devices, and the I2C is not reconfigured.

After 5 - 10 minutes of normal operation while debugging through Keil, a hard fault happens. I have no idea why this is happening, and I need some insight in how to troubleshoot this further.

I cannot see in the call stack the code execution that lead to the hard fault. How can I identify the code that lead to this? Also, are there any known issues with this.

As another detail, my bus is made of twisted pair wires and may not be the best for impedance, but as I said, it works for a relatively long time before faulting.

Thank you,

Noah

Related