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.

Stack available for TMS320F2812

Hi,

I am using TMS320F2812 and use some memory allocation for MOSARAM, M1SARAM, L0SARAM and L1SARAM for my application. From the memory map, I see that the total size of each of these memory segments sums up to 10K. Is all this stack available for my tasks to use? Also, is there a limit to the size of memory allocated per task?

Thanks,

Darshaan

  • darshana garach said:
    Is all this stack available for my tasks to use?

    Yes, all of the memory can be used for your application. 

    If you are asking if you should allocate all of that for your stack - it would be an  unusually large stack.  The stack pointer is 16-bits, though so as long as you have contiguous memory that can be addressed with a 16-bit pointer it can be used by the stack pointer.   Usually I allocate 0x400 for stack to begin and then increase/decrease once development shows how much I really need.

    darshana garach said:
    Also, is there a limit to the size of memory allocated per task?

    Nope.

    -Lori

  • Hi Lori,

    Thanks for your answer. I recently found this regarding C6000 series: http://processors.wiki.ti.com/index.php/TSK_stack_content_during_context_switching

    The question answers how much padding is sufficient to protect against an interrupt occurring at the worst possible moment? The answer is 632 bytes for c6000 architecture on BIOS 5.x.

    Can you please help me find a similar answer for C2000 series? I used Code composer v2.1.

  • darshana garach said:
    The question answers how much padding is sufficient to protect against an interrupt occurring at the worst possible moment? The answer is 632 bytes for c6000 architecture on BIOS 5.x.

    Hi Darshana,

    The BIOS team may know - I am going to move this thread to that forum for the experts there to comment. 

    Cheers

    Lori

  • Which version of DSP/BIOS are you using?   For old versions provided with CCS2.x you can get this info from the first few lines in the include/tsk.h file.

    One way to monitor stack usage is to use the Kernel/Object View (KOV).  KOV can be used to see max stack usage on a per TSK basis.  BIOS also has a dedicated interrupt stack.   KOV will show you how much is used.   You can run your application for several hours/days and check KOV for stack usage.

    The 28x requires far less stack than the C6x.   I would estimate that our worst-case need for interrupt processing is around 50 16-bit words per TSK.  

    Interrupt processing is handled on a separate ISR stack which needs to be able to handle the stack required by your ISR functions and also handle the register context for nested interrupts if you enable nested interrupts.

    Regards,
    -Karl-