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.

AM2434: MCU-PLUS-SDK-243x - Stack Usage 100%

Part Number: AM2434

Hi,

In our project, we recently encountered a problem regarding data verification while trying to launch the debugger:

We are using two cores for the project: R5_0_0 and M4F_0.

Upon investigating the issue further, it seems like there is no memory/the code for M4 is trying to overwrite some memory region already previously written to.

Here are two screenshots showing the way a part of the M4 linker.cmd file is currently configured:

 

And here is what the "Stack Usage" view on CCS IDE shows us for the same M4 project:

It shows that 100% of the stack units are being used (2392), but the linker file shows that we have more than enough space left for stack (total stack size of 16384).

I am trying to understand why the IDE shows that the stack usage is at 100%? Is there something I am missing? Also, are the two issues linked somehow?

If I expand to see what components have the highest stack usage:

Our project utilizes IPC and it seems like all the IPC library calls are consuming a significant amount of stack. Furthermore, if I expand those functions shown above, it seems like the DebugP function calls (such as _DebugP_logZone) are mostly responsible. For example:

I was wondering if this is normal and if there is a way to maybe disable DebugP easily to free up a significant amount of stack? Any other suggestion will also be greatly appreciated for both the issues mentioned so far.

Thank you.

  • Hi Himel,

    By default, the OCRAM cannot be used by the M4 core. You will need to set the RAT entry for OCRAM (0x70000000 to 0x70200000). The IPC uses the OCRAM areas:

    USER_SHM_MEM, LOG_SHM_MEM, and IPC_VRING_MEM etc.

    Best regards,

    Ming