Part Number: MSP432P4111
Tool/software: Code Composer Studio
Hello,
I have seen some other posts in the forum where users have trouble with the software invocation of the MSP432 BSL. The symptom is that the BSL works fine when invoked via hardware invocation or the lack of a main program (0xFF in first 8bytes of main memory). I ran into the very same problem as mentioned here(), but the solution there was not complete.
I have found that the software invocation should look like the following:
Interrupt_disableMaster(); for (int i=0; i < 240; i++) NVIC->IP[i] = 0; // This is critical! However SLAU622H does not mention this for SW invocation. NVIC->ICER[0] = 0xFFFF; NVIC->ICER[1] = 0xFFFF; NVIC->ICPR[0] = 0xFFFF; NVIC->ICPR[1] = 0xFFFF; BSL_INVOKE(BSL_UART_INTERFACE);
My key finding was that the interrupt priorities MUST be reset to zero. I also reset the Systick (BSL uses to find the baud), Timer A0 (BSL uses for 10 second timeout), and USCI A0 (UART used to program). So I add the following code prior to entering the BSL:
/* Make sure our MPU settings don't cause problems in the BSL. */ MPU_disableModule(); /* The BSL does not initialize some hardware it uses. It requires * the Systick (to determine UART baud rate) and Timer A0 (to set * the 10-second timeout). Prepare these for use by BSL. */ SysTick_disableInterrupt(); SysTick_disableModule(); Timer_A_stopTimer(TIMER_A0_BASE); /* Need to reset UART A0 for firmware update. Be sure to make the * corresponding GPIOs input pins. */ UART_disableModule(EUSCI_A0_BASE); GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN2); GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN3);
I hope this helps someone. You may want to update SLAU622H with the interrupt lines above. I was going nuts trying to figure out how to invoke the BSL for firmware updates in the field!
Best,
Mike