The following section describes the role of the target-specific startup code.

When you create a new project to produce an executable file using a target-specific project template, a file containing the default startup code for the target will be added to the project. Initially, a shared version of this file will be added to the project; if you want to modify this file, select the file in the Project Explorer and select Import to copy the file to your project directory.

ARM and Cortex-A/Cortex-R startup code

The target startup file typically consists of the exception vector table and the default set of exception handlers.

* Declared as a weak symbol to allow the user to override the implementation.

Note that ARM and Cortex-A/Cortex-R exception handlers must be written in ARM assembly code. The CPU or board support package of the project you have created will typically supply an ARM assembly-coded irq_handler implementation that will enable you to write interrupt service routines as C functions.

Cortex-M startup code

The target startup file typically consists of the exception vector table and the default set of exception handlers.

The vector table is structured as follows:

For each exception handler, a weak symbol is declared that will implement an endless loop. You can implement your own exception handler as a regular C function. Note that the name of the C function must match the name in the startup code e.g. void SysTick_ISR(void). You can use the C preprocessor to rename the symbol in the startup code if you have existing code with different exception handler names e.g. SysTick_ISR=SysTick_Handler.