ILLEGAL_BP issue and board reset

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

ILLEGAL_BP issue and board reset

475 Views
anup_manakeshwa
Contributor I

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.

0 Kudos
1 Reply

380 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Anup Manakeshwar.

 

“ILLEGAL_BP” error is not related with license. Normally it is on your HW or SW design.

First we need to know the problem is due to software or hardware side. Could you please create a new project with wizard, can you download and run the new project code on the board?

If the problem only happened on your own project(no problem with new project), There is no document on the list of illegal BP, but I will try to explain it in detail to you.

 

There can be many reasons for “ILLEGAL_BP” error message.

  1. unmapped interrupt vectors or non-serviced irq is enabled or incorrect ISR vector number is used. The illegal breakpoint error often happens when the MCU is getting lost and executes dummy code. If this happens whenever you enable your interrupt, check that the interrupt vector has been correctly initialized with the address of the interrupt service routine. If the interrupt vector is left blank (0xFFFF) this could be the cause of the problem.
  2. watchdogs: this might be a COP reset, check that the watchog, if enabled, is being fed correctly. Also please check that the stack is not overflowing.
  3. bad SW approach to RAM, e.g. some buffer overflows, STACK overflow…
  4. code optimization by CW may cause the JMP to non-defined program memory address and PC lost way.

 

Please check your code if it belongs to one of the reasons above.

 


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos