In “classic” MQX:
Reset vector at address 0x00 contains address of __boot function and stack pointer (filled by linker). They will be loaded automatically during reset sequence.
__boot function in boot.s contains code for these steps:
- Disable interrupts and clear pending flags
- Setup and switch to process stack
- If MCU has FPU and we enable it, code will initialize FPU module
- Call toolchain_startup function
toolchain_startup function is toolchain dependent function which will:
- initialize necessary hardware (clocks, ddr, watchdog, ...)
- initialize data - copy static variables from flash to RAM and clear zero sections
- …
- Call main() function
Main() function in mqx_main.c file call MQX (function _mqx()).
The bareboard startup does almost the same with exception of process stack – this is not necessary for bareboard project.
In CW bareboard project __thumb_startup() function in __arm_start.c file will initialize stack, hardware, FPU unit (if necessary), initialize data in RAM and call main() function. Some of init functions are located in __arm_eabi_init.c file
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------