10.9.6 __external__ Type Qualifier

This qualifier is used to indicate that the compiler should access variables or pointer targets which have been located in external memory. These memories include any that have been attached to the device, but which are not, or cannot, be accessed using the parallel master port (PMP) peripheral (see the __pmp__ Type Qualifier section). Access of objects in external memory is similar to that for PMP access, but the routines that do so are fully configurable and, indeed, need to be defined before any access can take place. See the External Memory Access section for more information on how the memory space is configured and access routines are defined.

The qualifier is used as in the following example.

__external__ int external_array[256]
               __attribute__((space(external(external_memory))));
__external__ char * myExternalPointer;

In addition to the qualifier, the array uses a memory space which would need to be predefined. The pointer in this example does not use the space attribute as it is located in data memory, but the qualifier indicates how the pointer targets are to be accessed. For more information on the space attribute, see the Variable Attributes section. For basic information on the memory layout and how program memory is accessed by the device, see the Address Spaces section.

For more on the qualifier, see the External Memory Accesssection.