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.

DM8127 - DSP stack memory

Other Parts Discussed in Thread: SYSBIOS

I'm running syslink examples 04 eith same changes. My cfg file is:


var SR_0 = {
name: "SR_0", space: "data", access: "RWX",
base: 0x8EC00000, len: 0x10000,
//base: 0x8D000000, len: 0x10000,
comment: "SR#0 Memory (64 KB)"
};

var SR_1 = {
name: "SR_1", space: "data", access: "RWX",
base: 0x8EC10000, len: 0xFF0000,
//base: 0x8D010000, len: 0xFF0000,
comment: "SR#1 Memory (15 MB)"
};

var DSP_STACK = {
name: "DSP_STACK", space: "data", access: "RWX",
base: 0x8E000000, len: 0xA000,
//base: 0x8D010000, len: 0xFF0000,
comment: "DSP STACK Memory (A000)"
};

Build.platformTable["ti.platforms.evmTI814X:dsp"] = {
externalMemoryMap: [
[ SR_0.name, SR_0 ],
[ SR_1.name, SR_1 ],
[ DSP_STACK.name, DSP_STACK],
[ "DSP_PROG", {
name: "DSP_PROG", space: "code/data", access: "RWX",
base: 0xB0000000, len: 0x3000000,
//base: 0x8E000000, len: 0x1C00000,
comment: "DSP Program Memory (12 MB)"
}]
],
codeMemory: "DSP_PROG",
dataMemory: "DSP_PROG",
stackMemory: DSP_STACK.name,
l1DMode: "32k",
l1PMode: "32k",
l2Mode: "256k"
};

Build.platformTable["ti.platforms.evmTI814X:video"] = {
externalMemoryMap: [
[ SR_0.name, SR_0 ],
[ SR_1.name, SR_1 ],
[ "VIDEO_PROG", {
name: "VIDEO_PROG", space: "code/data", access: "RWX",
base: 0x8FC00000, len: 0x200000,
comment: "VIDEO Program Memory (2 MB)"
}]
],
codeMemory: "VIDEO_PROG",
dataMemory: "VIDEO_PROG",
stackMemory: "VIDEO_PROG"
};

Build.platformTable["ti.platforms.evmTI814X:vpss"] = {
externalMemoryMap: [
[ SR_0.name, SR_0 ],
[ SR_1.name, SR_1 ],
[ "VPSS_PROG", {
name: "VPSS_PROG", space: "code/data", access: "RWX",
base: 0x8FE00000, len: 0x200000,
comment: "VPSS Program Memory (2 MB)"
}]
],
codeMemory: "VPSS_PROG",
dataMemory: "VPSS_PROG",
stackMemory: "VPSS_PROG"
};

var ammu = {
ctrlBaseAddr: 0x8E000000, /* align on 256 KB */
prgmBaseAddr: 0x80000000 /* align on 512 MB */
};

/*
* ======== ti.targets.elf.C674 ========
*/
var C674 = xdc.useModule('ti.targets.elf.C674');
C674.ccOpts.suffix += " -mi10 -mo ";
Build.targets.$add(C674);

When I print the address from a local variable in DSP, I see that be in heap and not in stack. Why?

  • The DSP stack (called system stack) is used only by HWI (ISRs) and SWI (Software interrupt service routines). All sysbios tasks have their own stack. This stack is allocated from the default heap when the task is created unless explicitly configured. That is why you will see local variable addresses of tasks from the heap memory.

  • Badri Narayanan said:

    The DSP stack (called system stack) is used only by HWI (ISRs) and SWI (Software interrupt service routines). All sysbios tasks have their own stack. This stack is allocated from the default heap when the task is created unless explicitly configured. That is why you will see local variable addresses of tasks from the heap memory.

    The memory map has this section:

    .far 0 b1000000 018121c8 UNINITIALIZED
    b1000000 01772018 Dsp_pe674.oe674 (.far)
    b2772018 000a0000 Dsp_pe674.oe674 (.far:taskStackSection)
    b2812018 00000140 rts6740_elf.lib : defs.obj (.far)
    b2812158 00000064 Server.oe674 (.far)
    b28121bc 00000004 --HOLE--
    b28121c0 00000008 rts6740_elf.lib : trgdrv.obj (.far)

    One of my local variables has the address 0xb1000db4. Why don't is the address in (.far:taskStackSection)? Can I allocate more space for stack? 

    My problem is when I allocate a big local variable buffer (int buffer[10000]) my DSP crashes.