Join our subscribers list to get the latest news, updates and special offers directly in your inbox
Overview
Boot Sequence is a process that brings life into a Microcontroller unit (MCU), It also plays a vital role in bringing the software and hardware up and running.
The boot process can have different firmware stages and hardware configurations depending on the hardware and firmware architecture. As the hardware configurations are limited, we can define a standard template to get the depth of the boot process.
• The boot sequence can be divided into four parts:
The Boot Process begins with the Power On Reset (POR). When an MCU is first powered up, it has to run predefined checks in the hardware to bring the MCU up, only when all the voltage and clock conditions are proper for operation. Until then this hardware circuitry holds the processor in the reset. This process is called the Power On Reset (POR).
After the POR Stage MCU comes out of the reset state. The processor starts pointing from the 0x0000_0000 address. This zero address can also be remapped to any other address in the address space with the help of Remapper hardware. With the remapping hardware, The processor still looks for 0x0000_0000 but now the Remapper hardware window changes the address to a new remap address. This results in booting/execution from different address spaces or different applications. This is also called Memory Aliasing.
Target application or the firmware needs the address-specific settings in the linker file configuration e.g. FLASH start address. Flash address configuration of the linker binds the functions (of an application) binary with the linker file configured address. Each function in a C Language has an address and when the function is called/executed the Program Count jumps to that specific address to execute the function. So it is required for compiled application code (.obj) to be linked with a specific target address, or memory aliased (Remapped) address.This boot setting for Remapper hardware is typically configured from the Boot Mode selection pin of the MCU. Processor internal circuitry reads this boot mode pin configuration to set the Remapper address as per the selected configuration. Only after this stage processor starts fetching instructions and data from the correct targeted memory address.
After the Memory Alias stage, where the processor takes the boot mode selection pin configuration and is ready to fetch the instruction from the target address, firmware booting starts.
Firmware boot starts with the fetch of a WORD (32 Bit Memory Addr) to the Program counter (PC). The program counter (PC) is loaded with the address 0x0000_0000 value. As PC points to the next address for the execution, the 0x0000_0000 address is loaded to the Main Stack Pointer (MSP). This is done in the hardware circuitry. PC after 0x0000_0000 points to the next instruction which is 0x0000_0004. The memory map of the ARM based MCU has 0x0000_0000 as the address to the top of the stack and 0x0000_0004 as the Reset Handler. This initial memory map, is part of the Memory segment that is called Vector Table.Also in the ARM based MCU, the Initial top of the stack is loaded before the first function (Reset Handler) of the application, allowing the Reset Handler to be written completely in C. As C code needs stack to run.
Reset Handler in ARM based MCU is considered as an entry point of the firmware. This value of the reset handler in the vector table is basically a pointer to the actual function.
EmbeddedWala
EmbeddedWala Apr 27, 2023 0 19.3K
EmbeddedWala Jun 14, 2023 0 19.2K
EmbeddedWala Apr 26, 2023 0 17.2K
EmbeddedWala Aug 30, 2022 0 15.3K
EmbeddedWala Apr 27, 2023 0 15.3K
EmbeddedWala Jun 19, 2022 0 4.5K
This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies Find out more here