Detect BDM connection at runtime in MCF51AC256

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

Detect BDM connection at runtime in MCF51AC256

1,424件の閲覧回数
antoniomagrì
Contributor II

I am trying to find a way to detect the presence of a debug connection at runtime. The idea is to use this with a custom implementation of assert() that would cause a break (via the HALT instruction) if the debugger is connected. The reason for this is that HALT will cause a reset if no debug connection is present and I want to avoid that. I found that in the S08 core I can test the DBGEN bit in DBGC (Debug Control) register, but there seems not to exist anything similar in the Coldfire V1.

 

Has anyone found a way to detect the presence of the debug interface at runtime?

 

Thanks,

 

Antonio

ラベル(1)
タグ(2)
0 件の賞賛
返信
4 返答(返信)

1,102件の閲覧回数
TomE
Specialist II

You might be able to have the debugger write a special value to a RAM location, and have the code check for that value.

Tom

1,102件の閲覧回数
miduo
NXP Employee
NXP Employee

Hi,

Unfortunately for ColdFire V1 it is not possible for the processor to detect when the BDM is attached. The pins related with the BDM are out of the memory map so the processor cannot read those pins. And there has no register bit for this purpose.

1,102件の閲覧回数
TomE
Specialist II

Have the assert call a function that has the ONE COPY of the HALT instruction in it.

The  from the debugger, set a breakpoint on that function (and therefore on the HALT instruction).

So when the code fails the asserts and goes to call the HALT function it ends up in the debugger.

Tom

0 件の賞賛
返信

1,102件の閲覧回数
antoniomagrì
Contributor II

Thanks for the response,

as for the idea of using a special ram location to check for "debugger connected" condition, I will try that, if it can be done automatically that would be a plus...

The purpose of the HALT instruction was to actually not need a breakpoint added, so in that case I could just not use HALT and set the debugger to break on the failed assertion function call.

Thanks again,

Antonio

0 件の賞賛
返信