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.

MSPM0G3507: Which unexpeccted interupt is used in my firmware?

Part Number: MSPM0G3507

Hi,

I got the firmware enter this error handler codes.

/* This is the code that gets called when the processor receives an unexpected */
/* interrupt. This simply enters an infinite loop, preserving the system state */
/* for examination by a debugger. */
void Default_Handler(void)
{
/* Enter an infinite loop. */
while(1)
{
}
}

How could find which interupt caused this issue?

Thanks.

Regards,

Justin

  • Hi Justin,

    Please insert the below into your code. Comment out any of these that you already have handlers for.

    /*
    * These are traps for debugging when you find that your code
    * ends up in the default handler for some unknown reason.
    * To keep the compiler from complaining, comment out the ones
    * below if you already have a working handler for that vector.
    *
    */
    void NMI_Handler(void){ __BKPT(0);}
    void HardFault_Handler(void){ __BKPT(0);}
    void SVC_Handler(void){ __BKPT(0);}
    void PendSV_Handler(void){ __BKPT(0);}
    void SysTick_Handler(void){ __BKPT(0);}
    void GROUP0_IRQHandler(void){ __BKPT(0);}
    void GROUP1_IRQHandler(void){ __BKPT(0);}
    void TIMG8_IRQHandler(void){ __BKPT(0);}
    void UART3_IRQHandler(void){ __BKPT(0);}
    void ADC0_IRQHandler(void){ __BKPT(0);}
    void ADC1_IRQHandler(void){ __BKPT(0);}
    void CANFD0_IRQHandler(void){ __BKPT(0);}
    void DAC0_IRQHandler(void){ __BKPT(0);}
    void SPI0_IRQHandler(void){ __BKPT(0);}
    void SPI1_IRQHandler(void){ __BKPT(0);}
    void UART1_IRQHandler(void){ __BKPT(0);}
    void UART2_IRQHandler(void){ __BKPT(0);}
    void UART0_IRQHandler(void){ __BKPT(0);}
    void TIMG0_IRQHandler(void){ __BKPT(0);}
    void TIMG6_IRQHandler(void){ __BKPT(0);}
    void TIMA0_IRQHandler(void){ __BKPT(0);}
    void TIMA1_IRQHandler(void){ __BKPT(0);}
    void TIMG7_IRQHandler(void){ __BKPT(0);}
    void TIMG12_IRQHandler(void){ __BKPT(0);}
    void I2C0_IRQHandler(void){ __BKPT(0);}
    void I2C1_IRQHandler(void){ __BKPT(0);}
    void AES_IRQHandler(void){ __BKPT(0);}
    void RTC_IRQHandler(void){ __BKPT(0);}
    void DMA_IRQHandler(void){ __BKPT(0);}

    When you run debug, you should hit one of these instead of the default handler.

    Best Regards,
    Brandon Fisher

  • Hi Brandon,

    Thanks.

    When my firmware receive a frame from UART0, it enters hardfault handler.

    What's meaning of hardfault?

    Thanks.

    Best Regards,

    Justin

  • Justin,

    Most typically I've seen these caused by misaligned accesses to flash memory. Have you modified your linker file at all? What are you doing with the UART data once it is received? 

    Best Regards,
    Brandon Fisher

  • Hi Brandon,

    I haven't changed linker files.

    UART codes are copied from GUI UART communication example. It's too complicated to track the issue.

    I suppose there is a memory leakage in the codes.

    Thanks.

    Best Regards,

    Justin

  • Hi Justin,

    UART codes are copied from GUI UART communication example. It's too complicated to track the issue.

    Are you referring to the gc_simple_json, or gc_simple_messagepack example? I did a quick scan and I didn't see any dynamic memory allocation going on in these examples, so I wouldn't expect a memory leak unless I've missed the portion of code where this is happening. 

    Is this on the same project as the one in this thread? 

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1252665/mspm0g3507-trouble-halting-target-cpu-during-debugging-project

    It's possible that whatever is causing memory corruption here is related to your debugging issue.

    Can you send your project to me? I can try running it on my end to see if we can track this down. 

    Best Regards,
    Brandon Fisher