- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ran out of stack space in my application, but only discovered this by seeing clobbered ram.
1. is there any good way to detect stack overrun (e.g. declaring a variable at the top of the stack region and check for magic number? If so what is the best way to do this?
2. is there a way I can increase the allocation to the stack?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Idgirod,
1. Is there any good way to detect stack overrun (e.g. declaring a variable at the top of the stack region and check for magic number? If so what is the best way to do this?
[JT] -See below
// This returns the number of bytes free till the top of RAM at the point of invocation.
UINT32 cfa_mm_MemFreeBytes(void);
// This function returns 0 if a stack overflow was not detected before
// Else it detected an overflow.
UINT8 blecm_DidStackOverflow(void);
2. Is there a way I can increase the allocation to the stack?
[JT] - Increasing the application stack size is not supported.
Let me know if this answers your questions.
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Idgirod,
1. Is there any good way to detect stack overrun (e.g. declaring a variable at the top of the stack region and check for magic number? If so what is the best way to do this?
[JT] -See below
// This returns the number of bytes free till the top of RAM at the point of invocation.
UINT32 cfa_mm_MemFreeBytes(void);
// This function returns 0 if a stack overflow was not detected before
// Else it detected an overflow.
UINT8 blecm_DidStackOverflow(void);
2. Is there a way I can increase the allocation to the stack?
[JT] - Increasing the application stack size is not supported.
Let me know if this answers your questions.
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, this does answer my question