cancel
Showing results for 
Search instead for 
Did you mean: 

Question about debugging

Vyacheslav Azarov
Associate III
Posted on January 25, 2016 at 18:22

Who know? How to detect session of debugger in user program? This is need for prevent  use coresponding i/o ports in program, during debugging the STM32F334. 

Thanks.

#debuging #debugging #debugging
5 REPLIES 5
Posted on January 25, 2016 at 19:28

Look at DBGMCU clocks being enabled, and peripheral settings.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Vyacheslav Azarov
Associate III
Posted on January 25, 2016 at 23:30

I read about it. Apparently there is no way to determine the connected debugger.

Posted on January 26, 2016 at 00:41

I'm pretty sure it is going to be perceptible in some manner. Look also at the ITM, DWT and CoreDebug registers.

By the time you reach main() some of the AHB/APB settings, and reset states are going to be a bit fogged up, but at the ResetHandler the debugger is likely to have tweaked enough settings for its own needs that you're going to be able to determine if you are running with/without a debugger attached.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 26, 2016 at 02:00

OutString(''Welcome to Nucleo F401RE\r\n'');

printf(''%08X %08X %08X %08X\n'',

  CoreDebug->DHCSR,CoreDebug->DCRSR,CoreDebug->DCRDR,CoreDebug->DEMCR);

printf(''%08X %08X %08X\n'',

  ITM->TCR, ITM->TER, ITM->IMCR);

printf(''%08X\n'',

  DWT->CTRL);

Welcome to Nucleo F401RE (On Debugger)

01010001 00000000 00000000 01000000

00000000 00000000 00000000

40000001

Welcome to Nucleo F401RE (Reset One)

03010001 00000000 00000000 01000000

00000000 00000000 00000000

40000001

Welcome to Nucleo F401RE (Reset Two)

03010001 00000000 00000000 01000000

00000000 00000000 00000000

40000001

Welcome to Nucleo F401RE (Debugger restarted)

01010001 00000000 00000000 00000000

00000001 00000001 00000001

9D513BA1

S_RESET_ST seems to flagging

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337e/CEGCJAHJ.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Vyacheslav Azarov
Associate III
Posted on January 26, 2016 at 10:09

Thank you very match. I so far do not know small details of machine debugger.

However, an unambiguous conclusion about the possible activity of the debugger can not be done, based on this information. Or is it, perhaps, not quite simple. Maybe C_DEBUGEN in DHCSR is unambiguous sign of activity the debugger? Description in ''8.2.2. Debug Halting Control and Status Register'' very insufficiently. I will explore.