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.

MSP432E401Y: How to perform an application-directed update or invoke BSL from application?

Part Number: MSP432E401Y

Hi,

on the BSL MSP432E401 documentation it says thta it is possible to do an application update and that the application just call the bootloader:

"Additionally, the application can call the bootloader in order to perform an application-directed update. In this case, the bootloader assumes that the application has already configured the peripheral that it will use for the update. This allows the bootloader to use the peripheral as is to perform the update. The bootloader also assumes that the interrupt to the core has been left enabled as well, which means that that application should not call IntMasterDisable() before calling the bootloader. After the application calls the bootloader, the bootloader copies itself to SRAM, branches to the SRAM copy of the bootloader, and starts the update by calling Updater() (for UART, SSI, and I 2C), UpdateBOOTP() (for Ethernet), AppUpdaterCAN() (for CAN) or AppUpdaterUSB() (for USB). The SVCall entry of the vector table contains the location of the application-directed update entry point."

But how do i do that on the code?

Here is the example  (Page 6) to software invoke BSL using MSP432R401:

#define BSL_PARAM 0xFC48FFFF // I2C slave address = 0x48, Interface selection = Auto
#define BSL_API_TABLE_ADDR 0x00202000 // Address of BSL API table
#define BSL_ENTRY_FUNCTION (*((uint32_t *)BSL_API_TABLE_ADDR))
((void (*)())BSL_ENTRY_FUNCTION)((uint32_t)BSL_PARAM); // Call the BSL with given BSL parameters
//To call the BSL from interrupt routine service, the NVIC IABR register must be cleared before invoking the
//BSL. The following examples demonstrates the BSL invocation by P6.7 which is set with low active
//interrupt.
//variable detect if we interrupt occurs
volatile bool jumpToBsl = false;
int main()
{
     // Stop watchdog
     MAP_WDT_A_holdTimer();
    // Setup P1.0 with LED output to detect if the interrupt occurs
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
    // Configure P6.7 as an input and enabling the interrupt
    MAP_GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P6, GPIO_PIN7);
   MAP_GPIO_interruptEdgeSelect(GPIO_PORT_P6, GPIO_PIN7, GPIO_HIGH_TO_LOW_TRANSITION);
   MAP_GPIO_clearInterruptFlag(GPIO_PORT_P6, GPIO_PIN7);
   MAP_GPIO_enableInterrupt(GPIO_PORT_P6, GPIO_PIN7);
   MAP_Interrupt_enableInterrupt(INT_PORT6);
   MAP_Interrupt_enableMaster();

   while(1)
  {
     MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);
     __delay_cycles(2000000);
     if (jumpToBsl)
    {
       jumpToBsl = false;
       MAP_Interrupt_disableMaster();
       // Setup interrupt priorities into 0x00 before entering bootloader
      for (int i=0; i < 240; i++) NVIC->IP[i] = 0;
     NVIC->ICER[0] = 0xFFFF;
     NVIC->ICPR[0] = 0xFFFF;
     NVIC->ICER[1] = 0xFFFF;
     NVIC->ICPR[1] = 0xFFFF;
     // Call the BSL with given BSL parameters
     ((void (*)())BSL_ENTRY_FUNCTION)((uint32_t)BSL_PARAM);
    }
  }
}
...
void PORT6_IRQHandler(void)
{
   uint32_t status;
   status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P6);
   MAP_GPIO_clearInterruptFlag(GPIO_PORT_P6, status);
   /* Toggling the output on the LED */
   if(status & GPIO_PIN7)
  {
   jumpToBsl = true;
  }
}

Is there an example for MSP432E401Y? I dont want to use GPIO to invoke BSL because i only have UART communication.

Best regards,

Michael

**Attention** This is a public forum