Nucleo F401R1 - Timer interrupt and lockup
I am using timer interrupts to read 2 optical encoders connected to 2 motors. Everything seems to run fine for a while, then I get a hard lockup and everything stops. The time can be 5 minutes or 2.5 hours. I installed and setup watchdog and when it does lockup, the watchdog triggers and reboots. Anyone seen this? Any suggestions on what to look for?
Watchdog is set for 10 seconds.
timer is configured as follows.
TIM_TypeDef *Instance = TIM5;
HardwareTimer *MyTim = new HardwareTimer(Instance);
MyTim->setOverflow(1000, HERTZ_FORMAT); // 1000Hz = 1ms, 2000Hz = 0.5ms
MyTim->attachInterrupt(actuatorEncoderScan_ISR);
MyTim->resume();