12.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>if necessary. You should only change it in very specific situations. For example, in case positiondependent vectors are used (B instructions instead of LDR PC) and the vector table must be generatedin RAM (or copied from ROM to RAM with patched offsets in the B instructions).• (cstart.asm only) Switch to the user-defined application mode as defined through the symbol_APPLICATION_MODE_ in the LSL file.This symbol is used to set the value of the CPSR status registerbe<strong>for</strong>e calling the function main.• (cstart.asm only) Switch to Thumb code if you specified command line option --thumb.• Initialize profiling if profiling is enabled. For an extensive description of profiling refer to Chapter 6,Profiling.• Initialize the argc and argv arguments.• Call the entry point of your application with a call to function main().Exit codeWhen the C application 'returns', which is not likely to happen in an embedded environment, the programends with a call to the library function exit().Macro preprocessor symbolsA number of macro preprocessor symbols are used in the startup code. These are enabled when youuse a particular option or you can enable or disable them using the assembler option --define with thefollowing syntax:--define=symbol[=value]In the startup file (cstart.asm and cstart.c) the following macro preprocessor symbols are used:Define__PROF_ENABLE____POSIX____USE_ARGC_ARGV__ARGCV_BUFSIZEDescriptionIf defined, initialize profiling.If defined, call posix_main instead of main.If defined, pass arguments to main: int main( int argc, char*argv[] ).Define buffer size <strong>for</strong> argv. (default: 256 bytes)The following table shows the linker labels and other labels used in the startup code.Define_START_Nextmainexit_lc_ub_stackDescriptionStart label, mentioned in LSL file (arm_arch.lsl)Real program address. (*)Start label user C program.Start label of exit() function.<strong>User</strong>/system mode stack pointer.212

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

Saved successfully!

Ooh no, something went wrong!