This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5419A: Heap .sysmem segment usage

Part Number: MSP430F5419A

Tool/software: Code Composer Studio

I have an application that is using the large model library: rts430x_lc_ld_eabi.lib running on a MSP430F5419A using FreeRTOS

I am trying to optimise memory usage and want to get an accurate feel for where memory is being consumed.

The heap size was initially set, within CCS Linker Basic Settings, to 13000. However I can reduce this value to 11000 without any ill effects. Below this failures occur.

The .map and link_info.xml files are being generated however neither file is giving enough information to understand why reducing the Heap-size  is causing memory exhaustion below 11000

I see that the .sysmem segment is being set to 11000 (0x2af0) from the following section generated in the .map file below. How can I find out what is using this area of memory.

.sysmem    0    00001c00    00002af8     UNINITIALIZED

               00001c00    00000008     rts430x_lc_ld_eabi.lib : memory.c.obj (.sysmem)

               00001c08    00002af0     --HOLE--

From the information above the .sysmem segment starts at 0x1c00 and finishes at 0x46F8 (adding 0x2af0 to 0x1c00)

Other lines within the .map file make reference to  rts430x_lc_ld_eabi.lib in the attributes/input sections column. However the Origin address of these lines is outside the range 0x1c00 - 0x46F8

How can I determine what is using the .sysmem segment?

 

  • I will send this to one of our experts tomorrow who can provide a better answer. Keep in mind that .sysmem is generally used as a dynamic memory allocation area. i.e. this gets used up at runtime, calls to malloc()... Thus you are not going to get much information by looking at the build time generated linker map files as they do not have any awareness of what the application is going to use.

    Regards,
    John
  • John, thanks for the response and your planned action. Just to let you know malloc() isn't used explicitly anywhere.

    The only runtime heap allocation is by FreeRTOS in the creation of tasks.

  • Extraduce said:
    How can I determine what is using the .sysmem segment?

    The .sysmem output section is used only for dynamic memory allocation.  It is the memory managed by malloc and related functions.  Please search the MSP430 compiler manual for the sub-chapter titled Specifying Where to Allocate Sections in Memory.  

    The linker does not create the section .sysmem by default.  If your code does not call any malloc functions, then FreeRTOS, or some other component, must call them.

    Thanks and regards,

    -George