Illegal BP

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

Illegal BP

5,415 Views
Redjis
Contributor I
I got the message "illegal break point".
I can resolve this problem while using the Large Memory Model on CodeWarrior.

Could someone explain me ?
Labels (1)
Tags (1)
0 Kudos
10 Replies

879 Views
Alban
Senior Contributor II

Hi Redjis,

You could read old messages or use the search engine to check if the question was not resolved before.
By looking for "Illegal" in the Forum search engine at the bottom, I found the following identical question to yours:
http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&message.id=769&query.id=1684#M76...

Have a look and, if your problem is different to all posts already present, please give us more details on what you do and what you want to achieve, otherwise it is not possible for us to find a solution for you.

Cheers,
Alban.

0 Kudos

879 Views
Redjis
Contributor I
I already read this post (and some others). It doesn't explain me why my program doesn't work in banked memory model but only in large memory model. Moreover this post talk about uP or COP and I don't understand what it means...

Furthermore, my program is not something very specific ; it just computes some fourier transformations.

Thanks.
0 Kudos

879 Views
Alban
Senior Contributor II

The COP means Computer Operating Properly, you may know it under the name of watchdog.
If you don't write into it within a certain time, the microcontroller thinks there is a problem with the software and generates a COP Reset.

Illegal BP could be coming from a interrupt not declared.
For instance, by changing memory model, may be an invalid address becomes existing in the new context.

Have you looked at which instruction makes the software crash ?
You can do so by going step by step for instance.

Also, have a look at the Program Counter = PC in the debugger window. Is the address displayed in a area of memory where your code is situated ? Because that is what the MCU tries to execute.

Cheers,
Alban.

0 Kudos

879 Views
Redjis
Contributor I
The assembly code displays a long list of BGND instructions from B000 to C4A6 and also from CA3E to FFFF.

The message in command line is "Other BGND C99D" (for example) and so "ILLEGAL_BP".
0 Kudos

879 Views
Alban
Senior Contributor II
So it looks like your code went in an area to execute something which is not your code.
Try to place breakpoints in your code to discover where from you are coming when your code is "running away".
You can also check that all interrupt vectors are declared and point to some function in your project, even if the function only includes a background instruction, at least you will see where you were interrupted by reading the return address in the stack.
 
Alban.
0 Kudos

879 Views
Redjis
Contributor I
... I didn't declare any interrupt function, so I don't need interrupt vectors ?
Sorry but I begin with HC12 so...
0 Kudos

879 Views
Alban
Senior Contributor II
You are welcome Redjis.
Even if you didn't declare any interrupt function, you have to check if some interrupts are enabled.
As you don't use interrupts, what is the status of the "bit I" in the CCR = Condition Code Register in the debugger window ?
In your software try and disable GLOBAL interrupts by using "DisableInterrupt__();" function.
0 Kudos

879 Views
Redjis
Contributor I
Thanks !
"Bit I" is active in the CCR ; I tried with "DisableInterrupts", but problem still here.

I can see the same problem in this thread :
http://www.embeddedrelated.com/groups/68hc12/show/10283.php
I tested these solutions, whithout success.

In an other post, I could read this answer: "I have found the ILLEGAL_BP problem. Turns out to be a readdressing of the xgate vector table issue." But I don't understand...

Message Edited by Redjis on 2006-08-09 08:33 AM

0 Kudos

879 Views
Alban
Senior Contributor II

Could you give the part number of the device your are using ?

May be you are using an S12X instead of an S12. The difference is the second core called XGATE that itself works on interrupts and it could generate the background instruction... but I doubt it if you see the CPU being in a random address...

Alban

0 Kudos

879 Views
Redjis
Contributor I
Hi !

I'm using MC9S12DP256B device !
0 Kudos