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.

CCS/MSP-EXP432E401Y: Code always enters in Default_Handler

Part Number: MSP-EXP432E401Y

Tool/software: Code Composer Studio

Hi. I am beginning to learn how to program MSP432 MCU and I'm facing an issue with a simple code that I made.

#include "msp.h"

#define Peripheral_BASE                                    ((uint32_t)0x40000000)                   //Peripherals start address
#define WDT_A_BASE                                           (Peripheral_BASE + 0x00004800)           //Base address for Watchdog

typedef struct {
    uint16_t RESERVED0[6];
    uint16_t CTL;
}WDT_A_Type;

#define WDT_A                                               ((WDT_A_Type *)WDT_A_BASE)

int main(void)
{
    
    WDT_A->CTL = 0x5A00 | 0x0080; // Stop watchdog
    char c[] = 'Hello World';
    int i = 0;
    return 0;
}

I don't know why but always the code ended up in the default_handler function. I don't know if I disable properly the WDT (but what I read from the document I think this is the way) or it is something else that I;m doing wrong. 

  • gomezramones said:
    I am beginning to learn how to program MSP432 MCU and I'm facing an issue with a simple code that I made.

    Can you clarify which MSP432 MCU you are using?

    The reason is the MSP432E and MSP432P series devices have different peripherals, in terms of the register addresses and register bits.

    The code to disable the watchdog, by writing to address 0x40004800, is for a MSP432P device. Attempting to execute that code on a MSP432E device will fail with a hard fault, due to being no peripheral register at that address.

    Also, for a MSP432P device the watchdog is active at device reset.

    Whereas on a MSP432E device the watchdog is disabled at device reset, and remains disabled unless enabled by the software.

  • Mmm I have MSP432E. Let me look it for MSP432E datasheet and see how to disable the WDT