ILLEGAL_BP

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

ILLEGAL_BP

5,651 Views
israel
Contributor I
Hello,
I am getting the following massage in the HiWave debugger. I read the other threads and still can not put my finger on the problem. i am using the MC9S12DP256 with the MOT 1.2 comp[iler.
in the startup code there is an implemantation in assembler that copies data from the non banked flash to start of RAM.  the start code in flash was $0e800 I needed some more allocation space so i have changed the ROM_C000 from  0xE800 to  0xEA00 in the prm file like I have done before when I needed more space.  when I change the address marked in red below in the start12.c file i get ILLEGAL_BP message when i run the application. Can someone advice?
I guess ir has somthing to do with the INITRM register following this action.
 
 
ROM_C000 = READ_ONLY  0xEA00 TO 0xFE00;    //line in prm file
 
thestart12.c
 
   __asm {
    ldx #$0EA00  ; point to the start Code in Flash.
    ldy #$2800  ; point to the start of on-chip RAM.
    ldd #$1700  ;  code size.
MoveMoreCode0:
             movb 1,x+,1,y+  ; move a byte of the bootloader into RAM.
    dbne d,MoveMoreCode0  ; dec byte count, move till done.
    ldx #$0ff8c  ; point to the start code in Flash.
    ldy #$03f8c  ; point to the start of on-chip RAM.
    ldd #$74  ;code size.
MoveMoreVect0:
             movb 1,x+,1,y+  ; move a byte of the bootloader into RAM.
    dbne d,MoveMoreVect0  ; dec byte count, move till done.
   }
}

   __asm {
    LDAB  #$00C1  ; write to the INITRM register to overlay the Flash bootblock with RAM.
    nop
    STAB     16  ; this instruction MUST use extended addressing an be aligned to an even byte boundary.
                nop
                nop
                nop
                nop
                nop
                nop
                nop
               
  }
 
thanks
Roy
Labels (1)
0 Kudos
Reply
2 Replies

911 Views
DanielM
Contributor III
Hi,

where are you executing the code from? Can it happen that the code is lost and no longer available to the CPU (i.e. overlayed by the RAM, overwritten (if in RAM), etc.)?

The debugger typically says "ILLEGAL BP" when it hits a BGND instruction it did not expect. Where does the PC point when the micro stops after hitting the "ILLEGAL BP"? Somewhere nonsensical? My bet is on code run-away...

Daniel

Message Edited by DanielM on 2006-09-07 08:17 AM

0 Kudos
Reply

911 Views
israel
Contributor I
I understand its probably a runaway of the code. what I can not understand is why changing the address(marked in red) to a bigger one as source of copy procedure and not a destination will cause such a run away. may be the INITRM should be configured differently?
Thanks,
Roy
0 Kudos
Reply