I have a big 12,000 block diagram that uses 2k of heap on the F2808. How can I increase available heap?

I have a diagram with > 12000 blocks and the memory usage is about 34k of program (in flash),8k of data.

The stack requirement is very low (< 128) but the problem is the heap. This diagram is asking for 2834 of heap ! I'm affraid I will need more as well.

The most that I can fit into the 280x is 1856.

How can I increase the heap memory allocation in the DSP ? What are ways in which I can manipulate my diagram to minimize the heap usage ?

best regards

A simple edit to "f2808flnk.cmd" will allow larger heap

The heap usage you are seeing seems high. Please send us the diagram so we can see why. Heap is used for:

  • data buffers when exchanging data with the PC (the "Include VisSim Communication Interface" code gen option).
  • matrix data allocation.
  • data storage for inputs and outputs of conditionally executed subsystems, local rate subsystems and subsystems run as a background task. If you are not using numerical integration, then select the code gen option "Minimize RAM Usage". This greatly reduces the size of the task structure which lowers RAM usage.

Note that all heap is allocated at boot time, so any failures are detected immediately.

Normally VisSim allocates heap from the "M0M1" memory block (2k) which is usually sufficient for the task, but it can be moved to the L0L1H0 block (16K) if need be by editing the file \vissim70\dsp\lib\f2808flnk.cmd and changing line:
.sysmem : > RAMM0M1, PAGE = 1
to
.sysmem : > DRAMH0, PAGE = 1