__ATTRIBUTE__ Variable Properties __stm32

Source: Internet
Author: User

attribute (at ()) variable attribute

Grammar
attribute (at (to address))
Where:
Address
is the desired address of the variable.

Usage
The variable is placed in it own section, and the section containing the variable is given a appropriate type by the COM Piler:
1.read-only variables are placed in a section of type RO.
2.Initialized read-write variables are placed in a section of type RW.
Variables explicitly initialized to zero are placed in:
1). A section of type ZI in RVCT 4.0 and later.
2). A section of type RW (not ZI) in RVCT 3.1 and earlier. Such variables are not candidates for the ZI-TO-RW optimization.
3.Uninitialized variables are placed in a section of type ZI.

Limit
The linker is isn't always able to place sections produced by the at variable attribute.
The compiler faults use of the ' at ' when ' it is used ' declarations with incomplete types.
Note
The GNU editor does not support this variable attribute

Example

const int X1 __attribute__ ((at (0x10000)) = 10; /* RO/
int x2 __attribute__ ((at (0x12000)) =/* RW/
int x3 __attribute__ ((at (0x14000)) = 0;/* RVCT 3.1 a nd earlier:rw.
                                          * RVCT 4.0 and Later:zi. * *
int x4 __attribute__ ((at (0x16000));/* ZI *

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.