MSPM0L1306: MSPM0L1306 enters Default_Handler before main after enabling interrupts

Part Number: MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG, TMS320F280049C

Title: MSPM0L1306 enters Default_Handler while using I2C target mode

Hi,

I am using MSPM0L1306 with CCS + SysConfig.

I am facing an issue where the MCU jumps to Default_Handler() and gets stuck in infinite loop due to an unexpected interrupt.

void Default_Handler(void)
{
    while (1) {
    }
}

Problem

The program was working normally before adding I2C functionality. After enabling I2C-related code, it enters Default_Handler.

I also noticed that sometimes the breakpoint near main() is not hit properly, and eventually execution reaches Default_Handler.

I want to identify which interrupt is causing this.

Project interrupts currently used

I am already using these interrupts in my project:

  • Timer interrupt: TIMG1_IRQHandler

  • Timer interrupt: TIMG0_IRQHandler

  • GPIO interrupt: GROUP1_IRQHandler

I also enable GPIO interrupt using:

NVIC_EnableIRQ(GPIOA_INT_IRQn);

I2C configuration (slave / target mode)

I am using I2C0 in Target (Slave) mode.

  • I2C instance: I2C0

  • Slave address: 0x50

  • SDA pin: PA0

  • SCL pin: PA1

  • TX FIFO trigger level: 1 byte

  • RX FIFO trigger level: 1 byte

  • Clock stretching: Enabled

I2C interrupts enabled in SysConfig

I enabled only these I2C interrupts:

  • DL_I2C_INTERRUPT_TARGET_START

  • DL_I2C_INTERRUPT_TARGET_STOP

  • DL_I2C_INTERRUPT_TARGET_TXFIFO_TRIGGER

I did NOT enable:

  • Target RX FIFO interrupt

  • Controller mode interrupts

  • NACK interrupt

  • Arbitration lost interrupt

I enable NVIC for I2C using:

NVIC_EnableIRQ(I2C_0_INST_INT_IRQN);

where:

#define I2C_0_INST_INT_IRQN I2C0_INT_IRQn

Communication setup

Master MCU is TMS320F280049C.

Communication requirement:

MSPM0 acts as slave and sends 3 bytes to master:

  1. Vehicle mode (1 byte)

  2. ADC low byte

  3. ADC high byte

Questions

  1. How can I identify which interrupt is causing Default_Handler?

  2. Is there any conflict between existing timer/GPIO interrupts and I2C target interrupt?

  3. Is there a recommended debug method for unexpected interrupts on MSPM0?

Any help would be appreciated.

**Attention** This is a public forum