Specifically, I've found that if I start openocd+gdb to debug over the usb-hosted JTAG, the tinyusb usb initialization code renders the JTAG debugging functionality nonfunctional.
This makes sense, of course And I can prevent the issue by recompiling my app without initializing my USB code.
However, what I would truly like to do is to make it automatic. That is, if I'm debugging, I'd like my code simply not to enable its USB support.
As I'd mentioned previously, this is code that I'm porting from ARM. In my ARM implementation, I have this method which has proven to be super-useful in a variety of situations. For example, I have a "softPanic" method that only panics when I'm debugging.
Code: Select all
bool currentlyDebugging()
{
return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) != 0;
}
If not, I understand, but thanks for your creative thinking.