Hi , I have a doubt about stack usage view, I set 512 for satck but in the stack usage view I see 272bytes as 100%.

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.
Hi , I have a doubt about stack usage view, I set 512 for satck but in the stack usage view I see 272bytes as 100%.

Hi,
Which tool are you using to analyze the stack usage? I think 512 is how much is allocated for the stack in your linker command file but your actual usage is only 272. Is that a correct understanding. If you can guarantee that in all usages of your application the stack never exceeds 272 then you can reduce the stack allocation from 512 to some smaller value but have some margin. I would just keep 512 as it is not very large.
Im using CCS 9.3.0 in view>>stack usage, im confused because of the 100% indication
I try with the hello example project myself. I try two experiments with one case allocated for 512 and another case allocated with 256 bytes of stack space. Both cases show the same stack usage graph with 120 as the maximum stack usage. The 100% is indicating for the _c_int00_noargs function it is using 120 bytes of stack and it is 100% of the maximum the program has used. If you click on other functions of your stack graph it will show the percentage with the 272 as the denominator. In my case, if I click on the UARTgets function, it will show 46% of stack usage which is calculated by (56 / 120 = 46%).
I don't understand why you rejected the answer. If you are not satisfied, I will transfer your post to the CCS team who supports the tool.