This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: MCU entering into exception handler state

Part Number: MSP432E401Y

Tool/software:

Issue:

We have tried shoring the I2C channel4 CLK to GND to replicate the scenario where the I2C communication link is broken between the MCU and Slave. Upon testing the scenario, we have observed that, once the CLK is shorted to GND, the MCU controller stops running as it is entering possibly into the exception handler state (HardFaultHandler). We also have an I2C Communication recovery mechanism implemented to bring the communication up if it is failed during runtime, which also seems not working in this issue scenario.

 Analysis:

As part of the issue analysis, we have tried the below steps:

 Once the failure condition is induced and the I2C communication enters failed state (by shorting the I2C CLK to GND), as part of the recovery mechanism, we have tried the below to analyze and fix the issue:

    • Cancelling ongoing I2C transaction before performing the recovery mechanism by using the driver function call (I2C_cancel).
    • Replaced the “I2C_transfer” function call with  “I2C_transferTimeout” with a timeout of 100ms to avoid indefinite hold of the I2C Channel
    • Once the I2C communication is failed, added driver calls to Disable, Reset and Enable the I2C driver before entering the recovery sequence using
      • MAP_SysCtlPeripheralDisable(SYSCTL_PERIPH_I2C4); 
      • MAP_SysCtlPeripheralReset(SYSCTL_PERIPH_I2C4); 
      • MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C4); 
    • Also, we have tried re-initializing the I2C driver post recovery sequence, and then re-configuring the I2C channel accordingly
  • However, the behaviour of the controller remained same, as the controller had entered the exception handler and SW stopped running/entered into WdG reset scenario in all the above scenarios.

Support Required:

In this case will need necessary support in understanding why the controller is entering into the Hard Fault exception handler upon making the driver calls in the above-mentioned error scenario.

  • Team,

    Can you please help us out with this question as soon as possible?

    Best Regards,

    Madhurya 

  • Is the HardFault triggered by your test case (grounding SCL), or by your recovery code?

    I don't see this phenomenon on my Launchpad using Example i2c_mastermode_simple_transfer. (Slave is an MPR121 breakout board from Adafruit [it was on the top of the stack in my gizmo box].) The bus does hang (SCL stuck low); I'm not sure yet which side is causing it.

    When you reach the HardFaultHandler, TI document AN01286 (here) may be useful to find what triggered it.