How to trap Double Bus Faults?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to trap Double Bus Faults?

ソリューションへジャンプ
1,778件の閲覧回数
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 解決策
746件の閲覧回数
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 返信
747件の閲覧回数
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 件の賞賛
返信