SLAU319AF July 2010 – September 2022
Setting the program counter to the memory location 0x1000 starts the BSL. The stack is always reset, and RAM is cleared. It should be noted that the GIE bit is not disabled, so this should be done by the calling application if interrupts are not desired and appropriately returned from "Return to BSL" if they are used.
Because the stack is reset, the location 0x1000 can also be called as a C function, as in the following example code:
__disable_interrupt();
((void (*)())0x1000)();
If a USB stack is operating before the USB BSL is invoked, this USB stack must be disconnected first. The following example shows the recommended sequence in C:
TI recommends clearing the configuration of any module registers that are used in the BSL application, because the configuration for the external application can interrupt the BSL application and cause unexpected behavior. One example is that in the USB BSL, the Timer_B module is used in clock initialization. If Timer_B is also used in the external application, this might cause a failure in BSL initialization.
__disable_interrupt();
USBKEYPID = 0x9628; // Unlock USB configuration registers
USBCNF &= ~PUR_EN; // Set PUR pin to hi-Z, logically disconnect from host
USBPWRCTL &= ~VBOFFIE; // Disable VUSBoff interrupt
USBKEYPID = 0x9600; // Lock USB configuration register
__delay_cycles(500000);
((void (*)())0x1000)(); // Call BSL
TI recommends testing this sequence on various hosts.