Dear Mr./ Mrs.
When I checked e200z7 core document, I couldn't find exception for stackover flow. Is not available stackoverflow exception for MPC5777C?
Best Regards.
Hi,
one option is to follow section "60.4 Using Debug Resources for Stack Limit Checking" in reference manual for MPC5744P:
https://www.nxp.com/webapp/Download?colCode=MPC5744PRM
This is not mentioned in RM for MPC5777C but it's still applicable.
You can also take a look at this thread for some code:
Next option is to use Memory Protection Unit when you can configure small area just below the stack as no writeable.
Regards,
Lukas
Dear Lukasz,
I cause stackover flow by calling recursive function in main source. But when I put breakpoint in IVOR13_Exception_Handler (IVOR13 - Data TLB Error Interrupt) , it don't stop. I set MSR. I set LED pin to test IVOR13. But not works for during debug mode also standalone mode. I wonder reason.
Best Regards.
How did you configured the MMU and where is your stack?
Regards,
Lukas
I used this source code for stack monitoring in main.c;
void config_SRAM(void){
PPCASM("e_lis %r4, 0x0000");
PPCASM("e_or2i %r4, 0x0000");
PPCASM("mtspr 563, %r4");
PPCASM("e_lis %r4, _stack_end@h");
PPCASM("e_lis %r4,_stack_end@l");
PPCASM("mtspr 316, %r4");
My function generate for stack overflow;
void generate_stack_overflow(int a) {
if (a== 0)
{return;}
a = 6;
generate_stack_overflow(a);
}
PPCASM("e_lis %r4, __SP_INIT@h");
PPCASM("e_or2i %r4, __SP_INIT@l");
PPCASM("mtspr 317, %r4");
}