Hello everyone, today I, Xiao Zhao, will share some ARM core knowledge with you. Taking the Cortex-M4 as an example, when the MCU powers on, it retrieves the stack pointer from address 0x0 and fetches the address of the first function to be executed by the MCU from 0x4 (the address is four bytes, so it offsets by four bytes). This function is generally the Reset_Handler, which is the reset function, entering an exception with the highest privilege level. Don’t ask why; this is the standard set by ARM, so remember it well.
ST Platform (STM32F4)
The STM32 powers on and determines the boot mode based on the BOOT0 and BOOT1 pins. Assuming it starts from Flash, address 0x0 maps to address 0x0800 0000 to retrieve the stack pointer, and 0x0800 0004 retrieves the address of the first function to be executed by the MCU, jumping to Reset_Handler.What operations does the Reset_Handler perform based on the startup file?
- Update the MSP stack pointer
- Initialize the system clock
- Copy the code segment (RW BSS) from Flash to SRAM
- Zero out the BSS segment
- Jump to the user main

Careful readers will notice that this is somewhat different from what is seen in MDK. After initializing the system clock, it jumps to __main(). This __main() is not the same as the main() function; __main() is a C library function that is encapsulated. Its essential work is similar to the above, initializing SRAM, and finally jumping to the user main function 
NXP Platform (S32K)
The S32K follows a similar process as above, where 0x4 retrieves the address of the first function to be executed, executing Reset_Handler, disabling interrupts, initializing registers, initializing ECC RAM, updating the stack pointer, initializing the system clock, initializing the BSS segment, and finally jumping to the user main.
Key Points
No matter what chip it is, if the core is the same, there are many similar features. Learning from the perspective of the core, whether it is automotive-grade, industrial-grade, or consumer-grade, once you understand one, you can understand them all. You are basically halfway into the realm of the experts.
The “Introduction to Automotive Embedded Software” has been updated, mainly with upgraded features, and the project code has been placed in the cloud drive. Next time, Xiao Zhao will update the firmware update content for Infineon (TC275). The MBD tutorial mentioned earlier will be postponed for a while.🤣