Hans, I agree about the component failure scenario being unlikely.
I assume that the PWM signal is generated by a HW timer, you are not running a 166 kHz interrupt...
What if the software crash writes to the timer configuration registers and changes the function to a normal output?
Do you have a comment to making ghe? PWM signal AC-coupled?
73 de SM5EIE /Gunnar