13.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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>void f(void) __at( 0xf0ff + 1 ) { }The function f is placed at address 0xf100.RestrictionsTake note of the following restrictions if you place a variable at an absolute address:• The argument of the __at() attribute must be a constant address expression.• You can place only global variables at absolute addresses. Parameters of functions, or automaticvariables within functions cannot be placed at absolute addresses.• A variable that is declared extern, is not allocated by the compiler in the current module. Hence it isnot possible to use the keyword __at() on an external variable. Use __at() at the definition of thevariable.• You cannot place structure members at an absolute address.• Absolute variables cannot overlap each other. If you declare two absolute variables at the same address,the assembler and/or linker issues an error. The compiler does not check this.1.4. Accessing Hardware from CIt is easy to access Special Function Registers (SFRs) that relate to peripherals from C. The SFRs aredefined in a special include file (*.h) as symbol names <strong>for</strong> use with the compiler.The <strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> supports the Cortex Micro-controller Software Interface Standard(CMSIS). You can find details about this standard on www.onarm.com.The product includes a full set of CMSIS files in the cmsis directory under the product installation directory.This includes SFR files <strong>for</strong> the supported devices and <strong>for</strong> the various Cortex cores. The organization ofthe CMSIS files in the product installation is as follows:cmsis/CM0/CoreSupportdirectory with Cortex-M0 header files and C filescmsis/CM0/DeviceSupport/vendor/device directory with Cortex-M0 device specific header filesand C filescmsis/CM3/CoreSupportdirectory with Cortex-M3 header files and C filescmsis/CM3/DeviceSupport/vendor/device directory with Cortex-M3 device specific header filesand C filesWhen you include CMSIS SFR file in your source you must set an include search path to the appropriateCMSIS directory.Example of including an SFR file:#include "stm32f10x.h"void main(void){4

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

Saved successfully!

Ooh no, something went wrong!