MPC5777C Stack overflow exception

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5777C Stack overflow exception

895 次查看
20Sidar04
Contributor III

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.

0 项奖励
4 回复数

875 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

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:

https://community.nxp.com/t5/MPC5xxx/MPC5744P-how-to-use-the-debug-registers-to-realize-the-quot/m-p...

Next option is to use Memory Protection Unit when you can configure small area just below the stack as no writeable.

Regards,

Lukas

 

0 项奖励

870 次查看
20Sidar04
Contributor III

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.

标记 (1)
0 项奖励

854 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

How did you configured the MMU and where is your stack?

Regards,

Lukas

0 项奖励

808 次查看
20Sidar04
Contributor III

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");

}

0 项奖励