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.

SIMPLELINK-MSP432-SDK: UART interrupt enable causes strange things to happen

Part Number: SIMPLELINK-MSP432-SDK

Using an MSP432P401, an altimeter and an IMU, both over I2C. Using one UART to talk to a range finder and another to talk to a Nordic 52832 for BLE. I won't include all of the code but the parts that matter. In fact, I stripped it down just to what follows in order to demonstrate the issue I have.

First I set the two different UART configs. Then, in main(), do the usual things like stop the watchdog, setup the clock system, config GPIO, set flash wait states, core voltage, ACLK, set the UART configs, enable them with interrupts, initialize I2C, configure the sensors, enable master interrupts, start a timer and go to sleep. Inside the timer ISR a bit is toggled. This is all very vanilla stuff straight out of the SDK. The issue I am having has to do with the highlighted line in blue below, when the interrupt (INT_EUSCIA2) gets enabled. When in debug or right after flashing the micro a scope probe on the GPIO that gets toggled shows that everything is working just fine. But, if I cycle power to the board, the GPIO is not getting toggled. Nothing happens. I went thru every line of code, commenting them out individually and narrowed it down to this one interrupt enable statement. If I comment it out, the GPIO toggles just fine on power cycle. Uncomment it and nothing works. What the heck? The Nordic 52832 is not sending anything over the UART back to the 432 on power cycle. Just in case, I tried clearing the interrupt right after enabling it and inside the UART ISR. Doesn't work. What am I doing wrong?

/* Setup the UART for LRF use */
const eUSCI_UART_ConfigV1 uartConfig =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
156, // BRDIV = 156 @9600 for 24MHz
4, // UCxBRF = 4 @9600 for 24MHz
0, // UCxBRS = 0
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // LSB First
EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
EUSCI_A_UART_MODE, // UART mode
EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION, // Oversampling
EUSCI_A_UART_8_BIT_LEN // 8 bit data length
};

/* Setup the UART communication paramaters to talk to the Nordic 52832 SoC */
const eUSCI_UART_ConfigV1 uartConfig_ble =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
13, // BRDIV = 13 for 24MHz @115200
0, // UCxBRF = 0 for 24MHz @115200
0, // UCxBRS = 0
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // LSB First
EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
EUSCI_A_UART_MODE, // UART mode
EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION, // Oversampling
EUSCI_A_UART_8_BIT_LEN // 8 bit data length
};

/******************** Main function ********************/

int main(void)
{

/* Halting WDT and disabling master interrupts */
MAP_WDT_A_holdTimer();

configureGPIO();

/* Set 2 flash wait states for Flash bank 0 and 1*/
MAP_FlashCtl_setWaitState(FLASH_BANK0, 2);
MAP_FlashCtl_setWaitState(FLASH_BANK1, 2);

/* Set the core voltage level to VCORE1 */
MAP_PCM_setCoreVoltageLevel(PCM_VCORE1);

/* Initializes Clock System */
MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_24);
MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
MAP_CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);

/* Starting and enabling ACLK (32kHz) */
MAP_CS_setReferenceOscillatorFrequency(CS_REFO_128KHZ);
MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);

/* Configuring UART Modules */
MAP_UART_initModule(EUSCI_A1_BASE, &uartConfig);
MAP_UART_initModule(EUSCI_A2_BASE, &uartConfig_ble);

/* Enable UART module */
MAP_UART_enableModule(EUSCI_A1_BASE);
MAP_UART_enableModule(EUSCI_A2_BASE);

/* Enabling UART interrupts */
MAP_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
MAP_Interrupt_enableInterrupt(INT_EUSCIA1);
MAP_UART_enableInterrupt(EUSCI_A2_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
MAP_Interrupt_enableInterrupt(INT_EUSCIA2);

/* Setup I2C to talk to BNO055 and BMP388 */
initI2C();

/* Setup BMP388 & BNO055 sensors */

config_BNP388();
__delay_cycles(20000);
config_BNO055();
__delay_cycles(20000);

bno_rslt = bno055_set_operation_mode(BNO055_OPERATION_MODE_CONFIG);
__delay_cycles(20000);

bno_rslt = bno055_set_operation_mode(BNO055_OPERATION_MODE_NDOF);
__delay_cycles(20000);

/* Configuring Timer A0 in Continuous Mode */
MAP_Timer_A_configureContinuousMode(TIMER_A0_BASE, &continuousModeConfig);

/* Enabling interrupts and going to sleep */
MAP_Interrupt_enableSleepOnIsrExit();
MAP_Interrupt_enableInterrupt(INT_TA0_N);

MAP_Interrupt_enableMaster();

/* Starting the Timer_A0 in continuous mode */
MAP_Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_CONTINUOUS_MODE);

while(1)
{

MAP_PCM_gotoLPM0();

}

/** Timer A0 interrupt handler **/
void TA0_N_IRQHandler(void)
{
MAP_Timer_A_clearInterruptFlag(TIMER_A0_BASE);
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P8, GPIO_PIN6);
}

Any suggestions are much appreciated. I'm beyond frustrated.