What is a start-up code in an MCU?
Starting up an MCU (Microcontroller Unit) involves executing a sequence of instructions that initializes the various on-chip peripherals and sets up the processor’s operating environment. This sequence of instructions is often referred to as the “startup code" and is typically provided as part of the development tools provided by the chip manufacturer.
The startup code is responsible for configuring several hardware and software aspects of the MCU to prepare it for the application code to run. Details of these tasks is as below:
Stack Pointer Initialization: Stack Pointer points to the memory location in RAM which will be used by the program to store the function call stacks and the local variables for each function call.
- Data Section Initialization: Data Section in the memory layout contains the initialized global and static variables.
- Block Started by symbol (BSS) Initialization: BSS Section in the memory layout contains uninitialized global and static variables.
- Vector Table Initialization: The vector table contains the function pointers of the interrupt callback functions.
- Configuring the Clock and Debug Setting: Depending upon the application, the clock setting defers so Start-Up can take care of the default clock settings or even the complete clock settings and ensures the application code runs at the correct speed.
For more details click on the link shared below:
https://embeddedwala.com/Blogs/embeddedsystem/how_startup_code_works
Comments
Post a Comment