**** Advance Notice ****

This site will be closed on 31 December 2015,

Important Information for users of NXP LPCXpresso

This site is for users of Code Red branded products.

NXP LPCXpresso users should visit the LPCXpresso FAQ's for up-to-date information relevant to that product.

Differences between revisions 2 and 3
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:

= Aligning data =

Data can be aligned by using the following attribute:
{{{
__attribute__((aligned(32))) unsigned char my_data[1234] ;
}}}

Placing data at an address

If you wish to place data (for example a buffer used by a peripheral) at a known address, you can use the following technique.

  • Place your data into its own section. e.g.

__attribute__ ((section(".myBuffer"))) unsigned char myBuffer[1024] ;
  • Modify your project to provide your own linker script. See OwnLinkScripts

  • If it doesn't exist, create a Memory region in the linker script for Memory

MEMORY
{
  /* Define each memory region */
  MFlash32 (rx) : ORIGIN = 0x0, LENGTH = 0x8000 /* 32k */
  RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* 8k */
  MyBufferRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x2000
}
  • Modify the linker script to place your data section to a known address

    .myBuffer (NOLOAD):
    {
        *(.myBuffer)
    } > MyBufferRAM

Aligning data

Data can be aligned by using the following attribute:

__attribute__((aligned(32))) unsigned char my_data[1234] ;

PlacingData (last edited 2013-11-18 13:46:19 by DerekMorris)