 Welcome to this video on using the STM32 boot mode. The STM32 family of microcontrollers contains an embedded ROM bootloader, which can be used to load the internal flash memory through a serial peripheral. This feature is useful for users who wish to program the entire STM32 internal memory image without the use of a JPEG programmer, or to provide a programming interface to the microcontroller for field service usage. The standard serial peripheral used across all STM32 families is the USART through RS232, but some STM32 families contain bootloader capabilities through CAN or USB interfaces. A detailed description of the bootloader process and available protocols can be found in application note AN2606. The embedded bootloader state machine is invoked by configuring two external pins, Boot0 and Boot1. The primary bootloader protocol for all STM32 devices is defined for RS232 over a USART port. The embedded bootloader is activated by configuring pins Boot0 and Boot1 as follows. To boot from the internal user flash memory, set pin Boot0 low. This is a normal boot operation for the STM32. Setting pin Boot0 to high and pin Boot1 to low will invoke the system memory boot mode, allowing programing of the STM32 memory space by the given serial protocol. Setting pins Boot0 and Boot1 both to a high voltage will select the embedded SRAM as the boot space. During a reset event, both bootpins are sampled and latched on the fourth system clock after reset. Here is a picture of the pinout for the LQFP64 device. Please refer to the specific datasheet for bitpin locations on other STM32 packages. Let's dive a little more into the exact structure of how the bootloader works. After a system reset, the bootloader pins are sampled. Based on the bootpin configuration, the STM32 will determine the starting address for the boot. In the case of normal operation, when booting from the internal flash memory, the starting address is hexadecimal 800 000. When invoking the system memory bootloader, the starting address is from the internal raw memory located at hexadecimal 1fff f 000. Booting from internal ROM will invoke the onboard bootloader over the serial protocol. When booting from SRAM, the starting address is hexadecimal 000 000. Other bootloader protocols are available depending on the STM32 device family selected. The use art over RS232 serial interface is available on all STM32 families. Some families have the ability to invoke the bootloader over CAN and USB interfaces. Please consult application note 2606 for a complete listing of available protocol. I will now demonstrate using the system memory boot mode to load a flash image into the STM32. This demonstration uses an STM32 F20-G evaluation board, an RS232 cable connected to USART1, and a Windows PC using a USB to RS232 serial converter. The program I use to flash the STM32 is called the ST Flash Loader Program, which can be found on the STM website labeled under user manual 0462. With the evaluation board, I now connect the RS232 cable to USART1. Next, I will connect the DC power supply to power on the board. There are two switches to set the boot pins, boot 0 and boot 1. I now set boot 0 to high, leaving boot 1 to low to enable the system memory boot mode. To invoke the embedded boot loader, press the reset button. Upon reset, the boot pins are red and the boot mode is selected. Moving to my Windows PC, I need to know the serial port number connected to my STM32, so I check under Windows Device Manager to find the serial port number. Here it is, COM54. With this information, I can now run the ST Flash Loader Program. First, I set the port name to COM54 and click Next. The Flash Loader connects to the STM32 and displays a green light that indicates it has connected to the microcontroller. Click Next to move to the device selection screen and select the appropriate device. In my case, this is the STM32F2 512K version. Click Next to proceed to the action menu. First, I select the Erase button to erase the entire contents of the flash memory. When the flash erase has completed, I click on the Download to Device button and select the binary image I wish to download. For this demonstration, I choose to load the Evaluation Board firmware binary. As I have previously erased the flash, I click the No Erase button. Upon clicking Next, the Flash Loader now downloads the image into the internal flash memory and verifies the contents of that memory. I now set the boot pins on the STM32 to boot from the user flash by setting the Boot zero pin to low. Pressing the Reset button will invoke the user image stored in the flash, running the Evaluation Board program. For additional information on running the embedded boot loader with the UseArt, CAN, and USB serial protocols, please refer to Application Notes 3154, 3155, and 3156. Thank you.