Skip to the content of the web site.

Beyond 32 KiB of memory

In Project 2, you were asked to allocate a block of 32 KiB of memory as a global array. As you may have noticed, it seems that 32 KiB is the maximum you can allocate in global variables, even if the LPC1768 has more memory, and the .

To access more memory, you must specify to the go OptionsOptions for Target Target_name... (also Alt-F7 or select the icon ). Under the Target tab, unselect IRAM1 and select IRAM2 togethe with the NoInit selected, and you must select Use MicroLIB; as shown in Figure 1.


Figure 1. Selecting IRAM2 with NoInit set

Ensure that the numbers are identical—the should be.

Next, select the Linker tab. Be sure to select the Use Memory Layout from Target Dialog.

Next, edit the file LPC17xx.s and select the Configuration Wizard (a tab at the bottom of the editting panel). Here you will see that both the stack and the heap can be set. Change both to 0x2000.

In order to declare your array, you must now use

unsigned char array[MAX_SIZE] __attribute__ ((section(".ARM.__at_0x10000000"), zero_init));