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.

Compiler/PROCESSOR-SDK-DRA8X-TDA4X: I want to confirm wheather there is a bug in SDK

Part Number: PROCESSOR-SDK-DRA8X-TDA4X

Tool/software: TI C/C++ Compiler

Hello,

I want to confirm wheather there is a bug here.
I found that the function AppUtils_GetStackUsage() in psdk_rtos_auto_j7_06_02_00_21/mcusw/mcal_drv/mcal/examples/utils/src/app_utils.c, it calculates the size of the stack usage by comparing it to
0xFEAA55EFU, but in fact, the stack is filled with 0xBEBEBEBEU.So calculating the usage of stack in this way will give you the wrong result.
I wonder if this is a bug or something else.
  • HI,

    Known pattern 0xFEAA55EFU is written to the entire stack size using AppUtils_SectionInit API during application StartUp code. 

    At the end of the application AppUtils_GetStackUsage is called to calculate the stack consumed.

    In AppUtils_GetStackUsage API, total stack size is known from the compiler macro __STACK_SIZE and stack start pointer from __stack.
    Pattern(0xFEAA55EFU) matching is done from the start of the stack and it is continued until pattern does not matches. The Stack
    region not consumed is updated in a variable freeEntry. Max stack used is calculated by (__STACK_SIZE - freeEntry).

    In your case looks like stack is not initialized and by default it is 0xBEBEBEBEU. Either you need to initialize with known pattern or with 0xBEBEBEBEU and you need to compare with this pattern only to calculate stack size.

    Please refer any of the mcusw example on how to use these API's.

    Regards,

    Sunil Kumar M S

  • Hi,

    Thank you for marking this thread resolved.

    Regards,

    Sunil Kumar M S