Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to boot STM32 from user flash?

STM32 microcontrollers are capable to boot from different sources such as:

  1. User-Flash
  2. System-memory
  3. Embedded-SRAM.

On the firmware side, does "boot from user Flash" means executing a custom bootloader?

like image 917
Ginu Jacob Avatar asked May 26 '15 05:05

Ginu Jacob


1 Answers

No.

The "Boot from User Flash" mode means that the application code that will be run after reset is located in user flash memory. The user flash memory in that mode is aliased to start at address 0x00000000 in boot memory space. Upon reset, the top-of-stack value is fetched from address 0x00000000, and code then begins execution at address 0x00000004.

In contrast, the "Boot from System Memory" mode simply means that the system memory (not the user flash) is now aliased to start at address 0x00000000. The application code in this case must have already been loaded into system memory.

The "Boot from Embedded SRAM" mode does not alias the SRAM address. When this mode is selected, the device expects the vector table to have been relocated using the NVIC exception table and offset register, and execution begins at the start of embedded SRAM. The application code in this case must have already been loaded into embedded SRAM.

For more details, refer to the Reference Manual for the specific family of STM32 devices you are using, in the section titled "Boot Configuration".

like image 192
sifferman Avatar answered Oct 29 '22 16:10

sifferman