Hello Albert Martin:
I did not get the first part of your question very well. But if you want to detect when the K60F MCU is in Debug mode, I guess you can use the ARM register DHCSR (Debug Halting Control and Status Register), which is at address 0xE000EDF0. Example below:
#define DHCSR_REG (*(uint32_t*)(0xE000EDF0))
int main (void)
{
if(DHCSR_REG & (uint32_t)(0x1))
{
// Debug mode
}
else
{
// Standalone mode
}
}
I hope this helps!
Regards,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------