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 !
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
Hi,
yes, if the patterns at the end are not rewritten, it means the stack didn't overflow.
Regards,
Lukas
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