Author Topic: HEAP and uTasker HEAP?  (Read 9066 times)

Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
HEAP and uTasker HEAP?
« on: May 19, 2009, 02:37:37 PM »
Hi Mark
I have been having a look at what part of my project that uses my RAM and have stumped over some things I do not understand.
In the µTasker operating system basics - V1.3 document, you describe how the memory is located in the available RAM.

When I look at my RAM (In the .xMAP file) I have the following sections:
20000000 - 200003FF, Vector RAM
20000400 - 20001E50, Static variables
20001E60 - 20002E60, HEAP
20002E60 - 20007A60, uTasker HEAP
20007A61 - 20008000, System stack

The parts I do not understand are the Vector ram and especially the HEAP.
Vector RAM are not mention in your documentation, but I expect that this are processor related?

The part that wonder me are that HEAP part, I can see that it is not used by the uTasker, but what part of the system are then using this RAM?

Regards Steen


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: HEAP and uTasker HEAP?
« Reply #1 on: May 19, 2009, 03:04:18 PM »
Hi Steen

The fact that HEAP is using space in SRAM is possibly a configuration error in the last service pack. Normally this is set to zero size.
In the file M52235EVB_FLASH.lcf (or which ever linker script is used in the particular project) you will find the following:

        HEAP_SIZE       = 0x1000;                                             /* {1} This can be left as zero if only uMalloc is used */

As the comment suggests, it can be left as zero when no library malloc() is used. If you are not using malloc()/free() from a library you can change this to 0 and then the area will reduce (it is presently possibly occupying 4k of SRAM unnecessarily!)

To the other sectors:
Vector RAM is used by the interrupt vectors. It is a 1k block reserved at the start of RAM for entering interrupt handlers and used by the interrupt controller. For this reason no system variables are allowed there.
- Note that, when using USB, the USB buffer descriptors can be positioned just after the interrupt vectors - see appendix A of the USB user's guide for full details: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

The variables sector contains all system variables (usually starting with zeroed variables and the then followed by initialised variables).

The uTasker Heap and stack are probably 'fictional' sectors since there are no defines for these (did you get the values from the memory command when the project was running?). These two areas are essentially shared from the remaining SRAM.
See also: http://www.utasker.com/forum/index.php?topic=96.0


Regards

Mark





Offline svl

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: HEAP and uTasker HEAP?
« Reply #2 on: May 20, 2009, 07:18:39 AM »
Hi Mark

The uTasker Heap and stack are probably 'fictional' sectors since there are no defines for these (did you get the values from the memory command when the project was running?). These two areas are essentially shared from the remaining SRAM.
See also: http://www.utasker.com/forum/index.php?topic=96.0
This was basically the explanation I was looking for, but was not able to find it, thanks. :D
And yes I was reading out the sectors from the debugger when the project was running.

The main thing was to understand the two HEAP sectors and to gain more SRAM for my application.

Ones again thanks..

Regards Steen