I do not know how to calculate the usage of STACK, the IDE is S32DS_ARM.
Hi @547416104
well, there's no easy way how to calculate the usage of stack. One option is to use "high water mark" method: generally, you should use a debugger to fill the stack with some pattern (like 0xAA, for example) and then examine all possible operations/paths of your application. Then watch the stack in memory and check the address up to which was the patter rewritten. This should give a good clue what the size of stack should be.
Because the RAM is initialized in startup files in S32DS project due to ECC right after reset (all the RAM is set to "0"), you do not need to bother with filling of some pattern as it is already 0x00.
Another thing is that you can monitor the stack to guarantee that no overflow or underflow happened. This was already discussed:
https://community.nxp.com/t5/S32K/Example-of-DWT-for-stack-usage-monitoring-on-S32K1xx/m-p/1160990
https://community.nxp.com/t5/S32K/DWT-on-S32K11x/m-p/960401
Regards,
Lukas