
AT32F413
Series Reference Manual
2022.06.27
Page 34
Rev 2.00
The initial value of MSP is followed by the vector table. Cortex™-M4F operates in Thumb state, and thus
each data value in the vetor table must set the LSB to 1. In
, 0x0000_0101 is used to represent
0x0000_0100. After the instruction at 0x0000_0100 is executed, the program starts running formally.
Before that, it is mandatory to initialize MSP, because the first instruction may be interrupted by NMI or
other faults before being executed. After the completion of MSP initialization, it is ready to prepare stack
room for its service routines.
Figure 1-6 Example of MSP and PC initialization
1st push data
2nd push data
Other Memory
0x2000_8000
0x0000_0101
Other Exception
Vectors
Boot Code
Other Memory
Code
Stack
Memory
Stack grows
downward
Initial SP Value
0x2000_8000
0x0000_0000
0x0000_0004
0x0000_0100
0x2000_7C00
0x2000_7FFC
0x2000_7FF8
0x2000_8000
In the AT32F413 series, the main Flash memory, Boot code or SRAM can be remapped to the code
area between 0x0000_0000 and 0x07FF_FFFF. BOOT1 and BOOT0 are used to select the specific
memory from which CODE starts.
{BOOT1, BOOT0}=00/10, CODE starts from the main Flash memory
{BOOT1, BOOT0}=01, CODE starts from Boot code
{BOOT1, BOOT0}=11, CODE starts from SRAM
After a system reset or when leaving from Standby mode, the pin values of both BOOT1 and BOOT0
will be relatched.
Boot code memory contains an embedded boot loader program that can be used to reprogram Flash
memory through USART1, USART2 or USB interface, and can provide extra firmware including
communication protocol stacks that can be called for use by software developer through API.