11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Data segmentsAdd the required heap size in the Heap size text box.Heap size allocation from the command lineThe size of the heap segment is defined in the linker command file.The default linker file sets up a constant, representing the size of the heap, at thebeginning of the linker file:-D_DATA16_HEAP_SIZE=size-D_DATA20_HEAP_SIZE=sizeNote: Normally, these lines are prefixed with the comment character //. To make thedirective take effect, remove the comment character.Specify the appropriate size for your application.Placement of heap segmentThe actual heap segment is allocated in the memory area available for the heap:-Z(DATA)DATA16_HEAP+_DATA16_HEAP_SIZE=08000-08FFFNote: This range does not specify the size of the heap; it specifies the range of theavailable memory.Heap size and standard I/OWhen you are using the Full DLIB configuration, be aware that the size of the input andoutput buffers is set to 512 bytes in the stdio library header file. If the heap is too small,I/O will not be buffered, which is considerably slower than buffered I/O. If you executethe application using the simulator driver of the <strong>IAR</strong> C-SPY Debugger, you are notlikely to notice the speed penalty, but it is quite noticeable when the application runs onan <strong>MSP430</strong> microcontroller. If you use the standard I/O library, you should set the heapsize to a value which accommodates the needs of the standard I/O buffer, for example 1Kbyte.If you have excluded FILE descriptors from the DLIB runtime environment, as in thenormal DLIB configuration, there are no input and output buffers at all.LOCATED DATAA variable that has been explicitly placed at an address, for example by using thecompiler @ syntax, will be placed in either the DATA16_AC or the DATA16_AN segment.The former is used for constant-initialized data, and the latter for items declared as__no_init. The individual segment part of the segment knows its location in thememory space, and it does not have to be specified in the linker command file.40<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

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

Saved successfully!

Ooh no, something went wrong!