When a target-specific executable project is created using the New Project Wizard,
the following default files are added to the project:
- Target_Startup.s — The target-specific startup
code. See Target startup code.
- crt0.s — The SEGGER Embedded Studio standard C runtime. See Startup code.
- Target_MemoryMap.xml — The target-specific memory map
file for the board. See Section Placement. Note that, for some
targets, a general linker placement file may not be suitable.
In these cases, there will be two memory-map files: one for a flash
build and one for a RAM build.
- flash_placement.xml — The linker placement file for a flash build.
- sram_placement.xml — The linker placement file for a RAM build.
Initially, shared versions of these files are added to the project. If you
want to modify any these shared files, select the file in the Project Explorer
and then click the Import option from the shortcut menu. This
will copy a writable version of the file into your project directory and change
the path in the Project Explorer to that of the local version. You can then
make changes to the local file without affecting the shared copy of it.
The following list describes the typical flow of a C program created with
SEGGER Embedded Studio's project templates:
- The processor starts executing at address 0x0000000, which is the reset
exception vector. The exception-vector table can be found in
the target-specific startup code (see Target startup code), and is put
into the program section .vectors, which is positioned at address
0x00000000 by the target-specific memory-map file.
- The processor jumps to the reset_handler label in the
target-specific startup code, which configures the target (see Target startup code).
- When the target is configured, the target-specific startup code jumps
to the _start entry point in the C runtime code, which sets up the C runtime
environment (see Startup code).
- When the C runtime environment has been set up, the C runtime
code jumps to the C entry-point function, main.
- When the program returns from main, it re-enters the C runtime
code, executes the destructors and enters an endless loop.