HCS08 - ILLEGAL_BP or Trigger A occurred messge

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

HCS08 - ILLEGAL_BP or Trigger A occurred messge

1,993 次查看
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


标签 (1)
0 项奖励
3 回复数

411 次查看
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 项奖励

411 次查看
roop
Contributor I
Thanks,

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

411 次查看
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 项奖励