How to trap Double Bus Faults?

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

How to trap Double Bus Faults?

跳至解决方案
1,769 次查看
ynaught
Contributor III
In the process of debugging my code, when the program runs "off in the weeds", sometimes I'll get a "Double Bus Fault" error.
 
I am using Wind River's (USB) Probe for In-Circuit debugging, and when you get a Double Bus Fault, it's rendered useless until you reinitialize it (which trashes any info that might've told me WTF happened).
 
My CPU is MCF5271.  All OS is homegrown.
 
What I expect is possible is defining a "fenced" area of memory from which the CPU is allowed to execute code, and a special exception vector I could use to catch instances of the PC going outside this range.
 
Anyone know how to pull this off?
 
Thanks.
标签 (1)
0 项奖励
回复
1 解答
737 次查看
ynaught
Contributor III
I now know the punchline to this joke so in case somebody else is suffering, here it is:
 
A bus fault triggers an exception (interrupt) handler.  A bus fault can happen when a non-existant memory location is read or written.
 
A double bus fault happens when an EXCEPTION HANDLER causes a bus fault.  In other words, your exception handler needs an exception handler, and Coldfire doesn't do that.
 
So for the most part, my solution for Double Bus Faults has been to issue a "halt" command in my exception routine (only when DEBUG mode is enabled), so I can crawl up in there with my ICE and find out what happened.  When DEBUG is disabled, the default is (usually) to do a hard reboot, which continues to work.

在原帖中查看解决方案

0 项奖励
回复
1 回复
738 次查看
ynaught
Contributor III
I now know the punchline to this joke so in case somebody else is suffering, here it is:
 
A bus fault triggers an exception (interrupt) handler.  A bus fault can happen when a non-existant memory location is read or written.
 
A double bus fault happens when an EXCEPTION HANDLER causes a bus fault.  In other words, your exception handler needs an exception handler, and Coldfire doesn't do that.
 
So for the most part, my solution for Double Bus Faults has been to issue a "halt" command in my exception routine (only when DEBUG mode is enabled), so I can crawl up in there with my ICE and find out what happened.  When DEBUG is disabled, the default is (usually) to do a hard reboot, which continues to work.
0 项奖励
回复