cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault on I2C library interrupt

MSchö.1
Associate

Hello everyone,

I encountered a weird situation concerning I2C on a project at work. We are using an STM32H743XIH6.

We have an I2C device sending data, the I2C is setup with a DMA. Everything works fine until we have a physical disconnection of the I2C bus (i.e vibrations).

On some occurrences, it triggers a hard fault. Attaching to the program when the FW is stuck, we got the following:

0693W00000QNNFdQAP.png0693W00000QNNFxQAP.png0693W00000QNNFZQA5.png 

By looking at the registers values above, the following bits are set for each registers:

itflags --> this is the I2C_ISR (0x18) register:

  • TXE is empty
  • STOPF Stop detection flag
  • BERR Bus error

itsources --> this is the I2C_CR1 register:

  • PE Peripheral enabled
  • STOPIE Stop detection interrupt enabled

From there, since the code gets stuck here, a HardFault is raised (below are the Fault registers):

CFSR:0x00000400

HFSR:0x40000000

DFSR:0x00000000

AFSR:0x00000000

MMFAR:0x00000000

BFAR:0x00000000

Is there anything we can do on the configuration ? I don't get why the Error Interrupt is not triggered or more simply, the error not handled.

Thanks for your enlightenment.

Best regards,

Marc

EDIT: I forgot to mention we tried with the version 1.3.0 and 1.9.0

0 REPLIES 0