maximum stack usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

maximum stack usage

180 Views
sanjay645
Contributor I

Hello, I am using s32k3 with s32 DS, please tell me how to know maximum stack usage in the program, i searched ld manual where i got a flag "--stack-analysis", but where should i put this flag in S32 ds? Is there any other option to see maximum stack usage of a program?

0 Kudos
1 Reply

108 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I'm not sure what's your compiler - for gcc you can use -fstack-usage option to get used stack for each function. During compilation is for each object file (*.o) generated *.su file with stack usage: 

jiri_kral_0-1706698736625.png

 

You can add -fstack-usage in project properties: 

jiri_kral_1-1706698904908.png

You can find more details here - https://mcuoneclipse.com/2015/08/21/gnu-static-stack-usage-analysis/

 

 

0 Kudos