MityDSP-L138 System Memory Allocation

This page discusses the system memory default allocation for use by the ARM and DSP processors and tips for potential custom modifications for this allocation.

MityDSP-L138 System Memory

The MityDSP-L138 has 128 MB mDDR memory that is used by both the DSP and ARM during run time. This memory can be divided into two main sections, memory used by the DSP processor and memory used by the ARM process.

ARM Memory Partition.

The ARM processor needs system memory for loading and running the kernel and for loading and running user level software. By default this is allocated to be 96 MB of the available 128 MB.

DSP Memory Partition.

The DSP processor needs memory for running the DSP code and communications with the ARM processor. By default this is allocated to be 32 MB of the available 128 MB.

The easiest way to view the system memory breakdown for the DSP is to view the .tcf file using the Code Composer Configuration Tool. By default if you double click on the .tcf file it should be opened to display in the Configuration Tool. The image below shows an example of what this tool looks like:

Note that all of the memory sections defined are not necessarily located in DDR (which spans address 0xC0000000-0xC8000000).

Custom MityDSP-L138 System Memory Partitions

It is possible to redefine the system memory partitions for a MityDSP-L138. However, keep in mind that you should only do this if it is absolutely required for your project and you have a good idea of what you are changing and why.

Below are some tips for choosing custom memory allocations.

Choosing a Custom Memory Allocation for the ARM

The ARM Process needs memory not only for loading and running the kernel, but also for all user space code that will be run. So you will need to have a good grasp on how much memory just your kernel is taking up, and how much memory you will need for your user space application(s).

Utilities such as top can be helpful in getting and idea for how close you are to using the memory you have available.

Keep in mind that if the system runs out of memory, allocation requests will start returning NULL and could result in confusing kernel panics and system crashes.

Choosing a Custom Memory Allocation for the DSP

Aside from room that your code will need to run (denoted as DDR), the DSP typically allocates a sections of memory called DSPLINKMEM and POOLMEM. This is memory used by DSPLink, which is the interface by which the DSP and ARM communicate.

Adjusting the MityDSP-L138 System Memory Partitions

There are three places where adjustments to the system memory partition must be made.

Kernel Arguments

The U-Boot environment variable "bootargs" has a parameter that we typically set as "mem=96M." This tells the kernel that there are 96 MB for use by the ARM. This number must be changed if a different memory allocation is going to be used for the ARM.

The DSP .tcf File

As insinuated earlier the .tcf file in the DSP side project contains the memory partitions used by the DSP. This file must be updated with the newly desired system partitions.

The ARM tsSharedMemCfg Structure

The ARM is the master responsible for loading the DSP. When a different memory allocation is specified in the DSP, it must also be mirrored in the ARM.

This is done by defining a tsSharedMemCfg structure, filling it in and passing it into the DspApp class via the SetSharedMemCfg() function before call the LoadApp() function. See the example code below for details:

    tcDspApp::tsSharedMemCfg memcfg;
    memcfg.RESETCTRLADDR     = 0xc4000000;
    memcfg.CODEMEMORYADDR    = 0xc4000080;
    memcfg.SHAREDMEMORYADDR0 = 0xC4800000;
    memcfg.SHAREDMEMORYADDR1 = 0xC4805000;
    memcfg.POOLMEMORYADDR    = 0xC4830000;


Go to top
Add picture from clipboard (Maximum size: 600 MB)