How to force a soft reboot on this T4.1

ninja2

Well-known member
I am using a Micromod Teensy and a T4.1 fitted to this expansion board from BurgessWorld on Tindie. I need both to have the capability for force a soft reboot. On the Micromod the instruction '_reboot_Teensyduino_()' does the job nicely, the processor shuts down and retarts cleanly.

But when I try the same on the T4.1 the processor shuts down but locks up into a state where it won't respond to the reset button (with the tiny red LED glowing). The only way I can recover is a full power cycle. I tried the expanded the shutdown function shown below, but it made no difference.

Is there a way around this?
(and as an aside: what does the tiny red LED indicate?)
TIA

Code:
void safe_system_reboot() {
  Wire.end();
  Serial.flush();
  Serial1.end();
  Serial2.end();
  pinMode(LEDpin, OUTPUT);
  digitalWrite(LEDpin, LOW);
  digitalWrite(PIEZOpin, LOW);
  delay(150);
  _reboot_Teensyduino_();           // Trigger software reboot
  while (1);
}
 
Try SCB_AIRCR = 0x05FA0004; instead. The _reboot_Teesyduino_() function triggers the bootloader chip, and if it detects a connected PC it will wait for a new program to be uploaded.
 
Back
Top