HCS08 - ILLEGAL_BP or Trigger A occurred messge

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

HCS08 - ILLEGAL_BP or Trigger A occurred messge

1,980 Views
roop
Contributor I
hi,

I am using MC9S08JM60 , I used SPI interface when I add code for write cycle , in debugger i get  either ILLEGAL_BP or Trigger A occurred message .  I am not set any Breakpoint or trigger .

I run code by using Stepover it works fine.

please help


Labels (1)
0 Kudos
3 Replies

398 Views
bigmac
Specialist III
Hello,
 
The most likely cause of this problem is a COP reset occurring while you are within a wait loop in your SPI communications function.  Here I assume that you would be waiting for the SPRF flag to become set.  It is possible for the normal register read operation of the debugger to clear the flag before your code can detect that the flag has become set, so that the wait loop would then never exit.
 
By stepping over the function, the debugger does not read the SPI registers within the wait loop, so the correct operation of the function occurs.
 
Regards,
Mac
 
0 Kudos

398 Views
roop
Contributor I
Thanks,

I am wait to set SPRF flag to set, but how do I resolve this problem?
0 Kudos

398 Views
bigmac
Specialist III
Hello,
 
As you have already found, the simplest way to resolve this issue is to step over the function, or place a break point following the function call.  The problem is caused by your attempt to single step the function.  If the function works correctly, there is little need for single stepping.
 
Regards,
Mac
 
0 Kudos