11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

•The processor jumps to the reset_handler label in the Target startup code (page 154)code which configures the target.•When the target is configured the Target startup code (page 154)code jumps to the_start entry point in the Startup code (page 155)code which sets up the C runtimeenvironment.•When the C runtime environment has been set up the Startup code (page 155) codejumps to the C entry point function main.•When the program returns from main, it re-enters the Startup code (page 155)code,executes the destructors and then finally enters an endless loop.Target startup codeThe 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 specificproject template, a file containing the default startup code <strong>for</strong> the target will be addedto the project. Initially a shared version of this file will be added to the project, if youwant to modify this file you should select the file in the project explorer and then selectImport to copy the file to your project directory.The target startup file typically consists of the following:•_vectors - This is the exception vector table. It is put into it's own .vectors section inorder to ensure that it is always placed at address 0x00000000.•reset_handler - This is the main reset handler function and typically the main entrypoint of an executable. The reset handler will usually carry out any target specificinitialisation and then jump to the _startentry point. In a C system the _start entrypoint is in the Startup code (page 155)file.•undef_handler - This is the default undefined instruction exception handler. Thishas been declared as a weak symbol to allow the user to override theimplementation.•swi_handler - This is the default software interrupt exception handler. This has beendeclared as a weak symbol to allow the user to override the implementation.•pabort_handler - This is the default prefetch abort exception handler. This has beendeclared as a weak symbol to allow the user to override the implementation.•dabort_handler - This is the default data abort exception handler. This has beendeclared as a weak symbol to allow the user to override the implementation.•irq_handler - This is the default IRQ exception handler. This has been declared as aweak symbol to allow the user to override the implementation.154 Chapter 14 <strong>ARM</strong> Target Support

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!