Yeah, for a project like this write some kind of
void error(int errcode)
{
_disable_irq();
GPIOx->MODER = // set the critical control pin as output
GPIOx->BSRR = // write the critical control pin to safe state (in this case, listen mode, transmitter disabled)
while(1)
{
// blink errcode counts on a LED.
}
}
Then make sure every interrupt handler (including hardfault, busfault, your default handler for unhandler ISRs, etc.) calls this function. Especially important for unmaskable highest-priority interrupts like hardfault. Then configure a watchdog which gives you highest possible priority interrupt (that would be next to hardfault) and call error() there, too. Now it should be impossible for any infinite loop to ever cause stuck driver.
Then, use different error codes from different call sites so that when things get stuck, you can look at the blinking LED and immediately rule out many wrong leads.