MPC 5634 stack or heap issue

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

MPC 5634 stack or heap issue

713 Views
windfield
Contributor I

How to check whether the MPC5634 stack and heap is overflow or not when running?  We find a issue when testing this MCU,the result of the sum of two data sometiems correct but sometimes is wrong,so i suspect the stack or heap is overflow,i want to check it,but i don't know how to check it,i need your help,thank you !

0 Kudos
3 Replies

636 Views
windfield
Contributor I

Hi Lukas,

     Thanks for your help,i tested your method, i set the pattern in the stack begin addreess and end address,all set 0x55AA,then run the code,both this two address data are not rewritten,what this mean?dose it work?

Regards,

Fei

0 Kudos

636 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

yes, if the patterns at the end are not rewritten, it means the stack didn't overflow.

Regards,

Lukas

0 Kudos

636 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

easiest option for debugging purposes is to fill the stack with some known pattern like 0x55AA after reset (this can be done by debugger), then run the code and watch the threshold where the patterns are not rewritten. This should help to check if the size of stack is sufficient.

Regards,

Lukas

0 Kudos