S12 BDMPod detection in App

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

S12 BDMPod detection in App

跳至解决方案
1,193 次查看
fmiku
Contributor III

Hello,

There is any possible way to detect a connected BDMPod to the controller in a runing firmware ?

My target is realtime bypassing of the wai and stop instructions while debugger are connected.

I very rarely using the debugger and I always stuck on same problem.

Because my firmware uses wai and stop the debugger can't connect and/or freezes when thh processor going to sleep.

so I always spend of hours to finding the problem, why de debugger is freezes....

I know I'm stupid a little...

My another question is, any easy way to disable all interrupts when I stopped and using trace command ?

currently im mods the CCR by hand to disable the interrupts.

I'm using BDMPod with Firmware: 6.0.0b17, Bootloader Version: 2.0.6 with S12G, S12VR, S12XS processors.

1 解答
997 次查看
RadekS
NXP Employee
NXP Employee

Hi Ferenc,
Unfortunately, my experiences with LFBDMPGMR are quite limited.
 
I am afraid that BDM connection is not the right tool for debugging MCU which going into stop mode.
The clocks are disabled and BDM connection lost in that case.


I think that you probably need some tool for real-time debugging. I would like to recommend for example Freemaster:
http://www.nxp.com/products/power-management/wireless-charging-ics/freemaster-run-time-debugging-too...
You may read/modify/write variables/register/… during run-time. It typically uses some serial channel like SCI for communication.
The disadvantage is that you need to implement and service serial driver in your code.

Note: The CPU can not enter a low power mode (stop or wait) during BDM active mode.


Yes, you may set I bit for mask all I-bit maskable interrupts.
Currently, I do not have any other idea how to do a different way.
Note: If your application uses COP, I would like to recommend trying to set RSBCK bit for stop the COP and RTI in Active BDM mode.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

3 回复数
997 次查看
kef2
Senior Contributor V

Hi Ferenc,

Since most of BDM debuggers most of the time start the debug session from resetting target into special single chip mode, you may detect it like this

      // wasn't BKGD pulled low at poweron / reset?

      if(MODE & MODE_MODC_MASK)
      {
             // no, it was high and not pulled low by BDM dongle

             // ,normal operating mode, we can WAI...

              asm("WAI");
       }

997 次查看
fmiku
Contributor III

Hi Edward,

It's an awsome idea !

works perfectly, Thank you ! :smileyhappy:

0 项奖励
回复
998 次查看
RadekS
NXP Employee
NXP Employee

Hi Ferenc,
Unfortunately, my experiences with LFBDMPGMR are quite limited.
 
I am afraid that BDM connection is not the right tool for debugging MCU which going into stop mode.
The clocks are disabled and BDM connection lost in that case.


I think that you probably need some tool for real-time debugging. I would like to recommend for example Freemaster:
http://www.nxp.com/products/power-management/wireless-charging-ics/freemaster-run-time-debugging-too...
You may read/modify/write variables/register/… during run-time. It typically uses some serial channel like SCI for communication.
The disadvantage is that you need to implement and service serial driver in your code.

Note: The CPU can not enter a low power mode (stop or wait) during BDM active mode.


Yes, you may set I bit for mask all I-bit maskable interrupts.
Currently, I do not have any other idea how to do a different way.
Note: If your application uses COP, I would like to recommend trying to set RSBCK bit for stop the COP and RTI in Active BDM mode.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------