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 overflow detection and AETLib support on C674x

Other Parts Discussed in Thread: SYSBIOS

Does anyone has idea how to detect stack overflow in C674x while code runs in release mode. I know the debug mode, and CCS can be used to check stack overflow.

There is one document available for C28X DSP's for detecting stack overflow, but I didn't find same for C674x. Also, anyone know whether it supports AET block and watchpoint registers which can be used to detect stack overflow?

  • Hi Shrikrishna,

    I've forwarded this to the SW experts. Their feedback should be posted here.

    BR
    Tsvetolin Shulev
  • Are you using TI RTOS on the C674x DSP? The TI RTOS has a Task_stat function that allows you to monitor the stack size. you can also use ROV tool integrated in CCS to view runtime stack usage of individual tasks. this has been described in the SYSBIOS user guide
    www.ti.com/.../spruex3q.pdf

    Also, check
    processors.wiki.ti.com/.../Checking_for_Stack_Overflow

    On c6000 devices the register B15 is used as the stack pointer. The stack grows from high addresses to low addresses. The stack pointer (B15) always points to the next unused location. The stack pointer must always be double-word aligned (least significant 3 bits must be 0). The C compiler and TI RTOS automatically maintain the proper alignment. Only in the case of hand-written assembly does the programmer have to take special care that the stack pointer never be mis-aligned. check the C6000 compiler USer guide for more details.

    DSP BIOS supported AET based watch points but you may need to check on TI RTOS forums if this is supported with SYSBIOS as well.

    Regards,
    Rahul

  • Hi Rahul,

    Thank you for the information.

    I am not using TI RTOS, and I wish to detect stack overflow while running my firmware in release mode (end application mode) to take safe action.

    I checked the AETLib and it has complete source code to add data watch-point programmatically, but its huge lib of 25K and I need to understand it first. Is there any documentation exists on AET registers and how to add watch points.

    I can definitely use B15 to check stack overflow (to check stack end), might be in periodic system tick ISR or something, and detect overflow. But still expecting some help on using AET for this.

     

    regards,

    Shri