brianmichalk
Active member
My Teensy 3.2, locks up randomly, and I've been trying for months to find this problem with little luck. It's a large program with multiple hardware devices, most implementing interrupt routines, so removing modules one at a time for testing is very difficult because other modules don't work properly, and also because it can take up to a day for the lockup to occur.
What issues could possibly cause a Teensy to lock up that the watchdog also fails to reboot the device? Some of my mitigating solutions:
1) Add ferrite beads to all wires
2) big copper pour on circuit board with a decoupling capacitor
3) Instrumented the code for DMAMEM to document entry and exit from subroutines
4) Print out the RCM registers to print cause of last reboot
5) Compile with "debug" and no LTO optimization.
6) CPU speed at 72MHZ.
When it locks up, I get this message from the kernel:
[444123.283708] usb 1-14: USB disconnect, device number 95
[444123.283938] cdc_acm 1-14:1.0: failed to set dtr/rts
If I try to load firmware via Arduino Teensy Loader, it fails because there is no serial device.
If I press the button, the Teensy will reboot and enter the update mode.
The machine is a brass case feeder, and I have discovered that static builds up on the brass, and is released when the cases strike other cases at a different voltage potential, so removing this source of noise is difficult.
This could be noise on the digital wires.
This could be a misbehaving ISR.
This could be bad power.
The causes of reboot are either "External Pin Reset" when it locks completely, or watchdog timeout when one of the motor operations takes too long. I have not seen any other causes.
What environmental factors could cause the WDT to not reset the device?
What issues could possibly cause a Teensy to lock up that the watchdog also fails to reboot the device? Some of my mitigating solutions:
1) Add ferrite beads to all wires
2) big copper pour on circuit board with a decoupling capacitor
3) Instrumented the code for DMAMEM to document entry and exit from subroutines
4) Print out the RCM registers to print cause of last reboot
5) Compile with "debug" and no LTO optimization.
6) CPU speed at 72MHZ.
When it locks up, I get this message from the kernel:
[444123.283708] usb 1-14: USB disconnect, device number 95
[444123.283938] cdc_acm 1-14:1.0: failed to set dtr/rts
If I try to load firmware via Arduino Teensy Loader, it fails because there is no serial device.
If I press the button, the Teensy will reboot and enter the update mode.
The machine is a brass case feeder, and I have discovered that static builds up on the brass, and is released when the cases strike other cases at a different voltage potential, so removing this source of noise is difficult.
This could be noise on the digital wires.
This could be a misbehaving ISR.
This could be bad power.
The causes of reboot are either "External Pin Reset" when it locks completely, or watchdog timeout when one of the motor operations takes too long. I have not seen any other causes.
What environmental factors could cause the WDT to not reset the device?