Reset
4 - 8 C2000 Microcontroller Workshop - Reset and Interrupts
Getting to main()
After reset how do we get to main() ?
At the code entry point, branch to _c_int00()
Part of compiler runtime support library
Sets up compiler environment
Calls main()
.sect “codestart”
LB _c_int00
CodeStartBranch.asm
MEMORY
{
PAGE 0:
BEGIN_M0 : origin = 0x000000, length = 0x000002
}
SECTIONS
{
codestart : > BEGIN_M0, PAGE = 0
}
Linker .cmd
Note: the above example is for boot mode set to M0 SARAM; to run out of Flash, the
“codestart” section would be linked to the entry point of the Flash memory block
After reset how do we get to main? When the bootloader process is completed, a branch to the
compiler runtime support library is located at the code entry point. This branch to _c_int00 is
executed, then the compiler environment is set up, and finally main is called.