AN2345 Freescale Semiconductor / Motorola, AN2345 Datasheet - Page 16

no-image

AN2345

Manufacturer Part Number
AN2345
Description
Real-Time Memory Manager for StarCore DSPs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Building Your Application with VSMM
4.3 Creating Heaps
16
Your application project must also include the VSMM_cfg.c source file. You are required to add the two
assembly files VSMMEnterCritical.asm and VSMMExitCritical.asm if you have elected to
use the default non-OSEck RTOS critical method 2 routines.
You must add a call to the VSMM routine VSMMMemInit() to your application at a point before any
VSMM routines are called. VSMMMemInit() must execute once within your system before your
application can use any of the VSMM features. After this initialization routine executes, VSMM is
available for use by your application.
Once VSMM is enabled, you can create any necessary memory partitions (heaps), from which all
allocations are performed. Before creating the heaps, you must decide whether to allocate specific
statically declared areas of memory from which the heaps are created (see Figure 9) or to use the system
heap space, as illustrated in Figure 10. If you chose to create heaps from several statically declared
memory areas, you must accurately define the size of these areas. If you opt to use the system heap area,
the system stack and system heap often share the same memory area, so the stack address runs up while
the heap runs down. It is essential to ensure that these two pointers never overlap.
0x1000
0 x 1 0 0 0
0 x 1 0 0 0
Freescale Semiconductor, Inc.
Figure 9. Statically Declared Heap Areas
For More Information On This Product,
Heap0
H e a p 0
H e a p 0
Go to: www.freescale.com
0 x 2 0 1 0 0 0
0 x 2 0 1 0 0 0
0x201000
H e a p 1
H e a p 1
Heap1
0x20001000
0 x 2 0 0 0 1 0 0 0
0 x 2 0 0 0 1 0 0 0
H e a p 2
H e a p 2
Heap2

Related parts for AN2345