AnsweredAssumed Answered

ILLEGAL_BP issue and board reset

Question asked by Anup Manakeshwar on Aug 15, 2017
Latest reply on Aug 21, 2017 by ZhangJennie

Hello

I am using MC9S12XEP100 16 bit controller in my project.
I have confiured the controller PLL to 80MHz and bus clock is 40MHz.
I want to receive data over CAN and store some frames in dFlash module.
There are total 4 CAN channles that i want to use - 3 will operate at 500kbps and 1 will operate at 125kbps.

Following is the psedo code of my program

main()
{

for ( i =0 ; i< 4; i++)
{
InitCAN(i);
}
/* Infinite main loop*/
for(;;)
{
main_func();
}

}


void main_func()
{
ProcessData();
LogData();
}

 

void CAN_Receive()
{
/*Push data in circuilar buffer in CAN driver*/
}


When I send the CAN data slowly from PC CAN software, i face no issues.
But when i send CAN frames in cyclic manner, then i face some issues.
The board resets some times. ( Got reset 20 times in 16 hours of overnight testing )

What i have observed that sometimes 'ILLEGAL_BP' issue was observed.
My guess is after execution of ISR, the controller is not able to fetch data from stack to load PC where it had left off to process CAN ISR.
I have kept the stack size to 2560 bytes. And most of the variables that i have declared are gloabal or static just to ensure my program does not eat up stack.

The 'ILLEGAL_BP' and board reset issue does not get observed if
1. If I poll CAN data instead of using interrupts.
2. If I comment my functions "ProcessData" and "LogData".
I have reviewed my code in "ProcessData" and "LogData" and dont see anything which will lead to crash.But when i uncomment the functions "ProcessData" and "LogData" , the ILLEGAL_BP issue comes back.

Is there is any way i can find out why ILLEGAL_BP issue is poping up.
Is MC9S12XEP100 Controller running on PLL 80MHz and bus clock 40MHz is correct configuration to process 4 CAN channles ?
(3 out of 4 will run on 500kbps and 1 will run 125kbps)

Currently i am using demo version of Code Warrior 5.9.0

Whether using licensed version will help in resolving 'ILLEGAL_BP' issue?

 

Thanks and regards,
Anup Manakeshwar.

Outcomes