I have a faint memory of something to check to see if running debug or not. anyone know?
Assuming we're talking Cortex-M ...
if( CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk ) { // Debugger is connected }
infocenter.arm.com/.../index.jsp
Although this thread says it doesn't work for Cortex-M0: http://www.keil.com/forum/60196/
M0:
..\Touch-user\process_button.c(214): error: #20: identifier "CoreDebug" is undefined if( CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk ) ..\Touch-user\process_button.c(214): error: #20: identifier "CoreDebug_DHCSR_C_DEBUGEN_Msk" is undefined
is there an include files beyont the "automatics" needed? or is it that M0 does not have the feature
You missed the last line of my first reply, then?
See also: community.st.com/.../36036-how-to-check-at-runtime-if-a-debugger-is-connected