ILLEGAL_BP Problem

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

ILLEGAL_BP Problem

10,585 Views
MIkeX
Contributor I
I am stuck right now in the debugger with an ILLEGAL_BP error. I don't know what this is or how fix it or get around it.
 
Any suggestions???
 
Thanks
 
Mike
Labels (1)
Tags (1)
0 Kudos
Reply
9 Replies

1,453 Views
RoadKill_CodeKi
Contributor I
I ran into this problem a few days ago. Turns out, I was working with redirecting interrupt vectors, and one interrupt vector was redirected into nowhere, which vectored the execution off into the weeds until the watchdog timer timed out. The message I got was ILLEGAL_BP, and the debugger was stopped at the entry point.
0 Kudos
Reply

1,453 Views
SSK
Contributor I
Hello,
 
I am also facing a ILLEGAL_BP error while using debugger. And this seems to be because of improper initialisation of interrupt vector. If I remove the ISR declaration, then I am facing the ILLEGAL_BP error but if I include the declaration for ISR, the linker is giving following error:
 
Link Error   : L1119: Vector allocated at absolute address 0xFFFE overlaps with sections placed in segment .absSeg218
 
Could you please clarify more on where I need to declare the ISR so as to avoid ILLEGAL_BP error?
 
Thanks in advance.
 
0 Kudos
Reply

1,453 Views
bigmac
Specialist III
Hello,
 
Your link error suggests that you have defined the reset vector (at address 0xFFFE) more than once, perhaps within the PRM file, and also within your code.
 
The interrupt vector that you refer to I presume is not intended to be the reset vector.  Perhaps the ISR definition is incorrect, and is improperly assumed to be at the reset vector location - or something along these lines.
 
There are a number of different ways of specifying the location of an interrupt vector - perhaps you should post the code you are using for the ISR.
 
Regards,
Mac
 
0 Kudos
Reply

1,453 Views
SSK
Contributor I
Hello Mac,
 
Thanks for the reply.
 
This is my code for ISR:
#define ISR(x) __interrupt void x(void)
 
#pragma CODE_SEG __NEAR_SEG NON_BANKED

ISR (ISR_SCI0)
{
 UCHAR scistatus = 0;
 UCHAR scidata = 0;
 scistatus = SCI0SR1;
 if (scistatus & (SCI0SR1_OR_MASK | SCI0SR1_FE_MASK | SCI0SR1_NF_MASK))  // Is any error flag set?
  {
    if (scistatus & SCI0SR1_OR_MASK)         // Is overrun error detected?
    {
      scistatus = 0x01;                // If yes then set an internal flag
    }
    if (scistatus & SCI0SR1_NF_MASK)         // Is noise error detected?
    {
      scistatus = 0x08;                // If yes then set an internal flag
    }
    if (scistatus & SCI0SR1_FE_MASK)         // Is framing error detected?
    {
      scistatus = 0x02;                // If yes then set an internal flag
    }
    scidata = SCI0DRL;                // Dummy read of data register - clear error bits
    //StatReg &= ~SCI0SR1_RDRF_MASK;         // Clear the receive data flag to discard the errorneous data
 }
 if (scistatus & SCI0SR1_RDRF_MASK)         // Is the receiver interrupt flag set?
  {
    scidata = SCI0DRL;                // data read
  }
  SCI0DRL = scidata;
  //if (SCI0CR2_SCTIE)                 // Is the transmitter interrupt enabled?
  {
    if (scistatus & SCI0SR1_TDRE_MASK)        // Is the transmitter interrupt flag set?
    {
     scistatus = SCI0SR1;
    }
  }
}
#pragma CODE_SEG DEFAULT
 
Below is my isr table:
 
extern void near _Startup(void);       /* Startup routine */
//extern void near ISR_RTI(void);
extern void near ISR_SCI0(void);
 
#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
__interrupt void UnimplementedISR(void)
{
   /* Unimplemented ISRs trap.*/
   asm BGND;
}
 
typedef void (*near tIsrFunc)(void);
const tIsrFunc _vect[] @0xFF80 = {     /* Interrupt table */
        UnimplementedISR,                 /* vector 63 */
        UnimplementedISR,                 /* vector 62 */
        UnimplementedISR,                 /* vector 61 */
        UnimplementedISR,                 /* vector 60 */
        UnimplementedISR,                 /* vector 59 */
        UnimplementedISR,                 /* vector 58 */
        UnimplementedISR,                 /* vector 57 */
        UnimplementedISR,                 /* vector 56 */
        UnimplementedISR,                 /* vector 55 */
        UnimplementedISR,                 /* vector 54 */
        UnimplementedISR,                 /* vector 53 */
        UnimplementedISR,                 /* vector 52 */
        UnimplementedISR,                 /* vector 51 */
        UnimplementedISR,                 /* vector 50 */
        UnimplementedISR,                 /* vector 49 */
        UnimplementedISR,                 /* vector 48 */
        UnimplementedISR,                 /* vector 47 */
        UnimplementedISR,                 /* vector 46 */
        UnimplementedISR,                 /* vector 45 */
        UnimplementedISR,                 /* vector 44 */
        UnimplementedISR,                 /* vector 43 */
        UnimplementedISR,                 /* vector 42 */
        UnimplementedISR,                 /* vector 41 */
        UnimplementedISR,                 /* vector 40 */
        UnimplementedISR,                 /* vector 39 */
        UnimplementedISR,                 /* vector 38 */
        UnimplementedISR,                 /* vector 37 */
        UnimplementedISR,                 /* vector 36 */
        UnimplementedISR,                 /* vector 35 */
        UnimplementedISR,                 /* vector 34 */
        UnimplementedISR,                 /* vector 33 */
        UnimplementedISR,                 /* vector 32 */
        UnimplementedISR,                 /* vector 31 */
        UnimplementedISR,                 /* vector 30 */
        UnimplementedISR,                 /* vector 29 */
        UnimplementedISR,                 /* vector 28 */
        UnimplementedISR,                 /* vector 27 */
        UnimplementedISR,                 /* vector 26 */
        UnimplementedISR,                 /* vector 25 */
        UnimplementedISR,                 /* vector 24 */
        UnimplementedISR,                 /* vector 23 */
        UnimplementedISR,                 /* vector 22 */
        UnimplementedISR,                 /* vector 21 */
        ISR_SCI0,                         /* vector 20 */
        UnimplementedISR,                 /* vector 19 */
        UnimplementedISR,                 /* vector 18 */
        UnimplementedISR,                 /* vector 17 */
        UnimplementedISR,                 /* vector 16 */
        UnimplementedISR,                 /* vector 15 */
        UnimplementedISR,                 /* vector 14 */
        UnimplementedISR,                 /* vector 13 */
        UnimplementedISR,                 /* vector 12 */
        UnimplementedISR,                 /* vector 11 */
        UnimplementedISR,                 /* vector 10 */
        UnimplementedISR,                 /* vector 09 */
        UnimplementedISR,                 /* vector 08 */
        //ISR_RTI,                          /* vector 07 */
        UnimplementedISR,                 /* vector 06 */
        UnimplementedISR,                 /* vector 05 */
        UnimplementedISR,                 /* vector 04 */
        UnimplementedISR,                 /* vector 03 */
        UnimplementedISR,                 /* vector 02 */
        UnimplementedISR,                 /* vector 01 */
        UnimplementedISR,                 /* vector 00 */
        _Startup                          /* Reset vector */
   };
 
Please let me know where I am going wrong. Thanks in advance.
0 Kudos
Reply

1,453 Views
CrasyCat
Specialist III
Hello
 
If you did define the vector table as indicated below, you need to remove the line VECTOR 0 _Startup
from your .prm file.
 
You should be able to link after that.
 
CrasyCat
0 Kudos
Reply

1,453 Views
Z_Warriors
Contributor I
Hello guys,
I had the "ILLEGAL_BP" problem some days ago... the cause was a bad initialization of the COP timer (WatchDog). I set the COP-timeout period to a very short value (about 10ms), so the application went immediatly to reset... and debugger said "ILLEGAL_BP"!!! So I solved this problem by setting the timeout periodo to a longer value (256ms)...

0 Kudos
Reply

1,453 Views
MIkeX
Contributor I
This was very simular to what I finally found. Thr xgate vectors were being relocated into never never land.
 
Thanks for the help
0 Kudos
Reply

1,453 Views
mke_et
Contributor IV
Illegal BreakPoint
 
Most common cause, for me anyway, is an unbalanced stack.  Then when I do a return from subroutine it's off to visit Neverland, and you know that's shut down.
 
If you got to the point your program was running and then hit this, and you can't figure out where it came from, try running or single stepping your init code.  If you can get to a 'main menu', let it get there, then start with F6/F5 to let it go, and watch where it goes.  If you get the failure, just reset and let it run to the last known stopping point that was good. 
 
If it's a stack collision, try filling your stack with a 'pattern' value, and keep a memory window looking at the stack to see how far it 'grows'. 
 
Also, every time you stop in the main code sequence, your stack should actually be sitting at the same spot.  Is it? 
 
Hey, when you start getting these kinds of things, sometimes you just have to bite down and start single stepping everything.  But try to get a mindset of 'divide and conquer' to limit your wasted time and effort.  Keep dividing what you have to 'it works here' and 'it doesn't work here' kind of thing.
 
 
0 Kudos
Reply

1,453 Views
MIkeX
Contributor I
Thank You, I'll Try looking a tthe stack values
0 Kudos
Reply