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.

How to set and check heap size and what sysBios heap modules are needed

Other Parts Discussed in Thread: SYSBIOS, CCSTUDIO

Hello,

I want to set the heap size for my CCS 5.1.09000 project running on an EVM 816X (loading on the C674X processor).

How can I check what it is currently set to? I see nothing called "heap" in my .map file. From other posts it sounded like the heap size might be listed under "sysmem" but that string is also absent from my .map file. The way I'm testing whether I've successfully increased my heap is by running my project in the debugger. I have been getting this error:

[C674X_0] ti.sysbios.heaps.HeapMem: line 296: out of memory: handle=0x800aceb8, size=1284
xdc.runtime.Error.raise: terminating execution

I'm assuming that when I have set my heap successfully to a large value this error will go away.

If I add a line like "-heap  0x1000" to my own .cmd file, I see no change in the .map file.

If I add the value 0x1000 to the field "Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" under C6000 Linker, Basic Options, in the project properties, I see no change in the .map file.

My generated linker.cmd file has this line "-heap  0x0" but I'm not sure why. There is nothing in my platform package which specifies a heap size.

To just create a simple heap, do I need to include any modules with "heap" in the name in my .cfg file? My .cfg file currently has these lines but I don't fully understand what they will do:

var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');

What is the simplest way to create a heap for the project?

How can you check that your heap has been created and has the right size?

Where is a good reference for what all the heap modules in the .cfg file are for and when you might need them and when you don't need them? By the way, many links seem to be broken today. A reply to one of my posts in January pointed to this link which isn't working today: http://www.ti.com/lit/an/spraas7e/spraas7e.pdf

Thanks,
Annie


  • Hi Annie,

    I'm assuming you are using SYS/BIOS. By default, SYS/BIOS creates a default heap (HeapMem) for you.

    Can you open ROV (under Tools in CCS) after you load and run (and it crashes)? You can see the size of this heap and more importantly, what is remaining.

    Here is a discussion of the heaps http://e2e.ti.com/support/embedded/bios/f/355/t/153456.aspx#555910

    You can increase the size in your .cfg file.

    BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize = 65536;

    Note: with SYS/BIOS you can have multiple heaps in your application. They can be of different types (HeapMem, HeapBuf, HeapMultiBuf) also depending on what your requirements are (e.g. fast, variable length, etc.). The different heaps can be accessed via a generic Memory module interface (e.g. Memory_alloc/Memory_free).

    Todd

  • Todd,

    Thanks for your reply and the links. Setting BIOS.heapSize to a value is affecting the totalSize I see in the ROV display after the crash.

    Yes, I am using SYS/BIOS. Sorry, I originally posted to the CCS forum and didn't give the SYS/BIOS details.

    Annie.

  • Can I go ahead and mark this as closed?

    Todd

  • Could you first point me to a reference describing the different heap types (HeapMem, HeapBuf, HeapMultiBuf)?

    Can different heaps be put into different sections of memory? Specifically, could one heap be put into internal memory since we know we care about fast access for items which use that heap?

    Thanks.

  • I think I've answered my question. I should look at chapter 6 of Bios_User_Guide.pdf in my C:\CCStudio_v5.1\bios_6_32_05_54\docs folder.