Teensy 4.0 randomly reset by itself

Status
Not open for further replies.

ElkinDiaz

Member
Dear PJRC Community,

I am trying to migrate Teensy 3.2 projects into the new Teensy 4.0, ideally using the same arduino firmware with compatible libraries should be compatible, and the performance theoretically might improve.

Actually, I have done the first prototypes, while the Teensy 4.0 seems to be better in performance, it randomly produce automatic resets, and then my software get unresponsive. I have tried multiple configurations on the frequency and there is not any relation with it.

I have checked the 3.3V OUTPUT, and it seems is randomly shutting its output.

The same firmware runs stable and properly in a Teensy 3.2.

What could you recommend to solve this issue? Please let us know what type of further information is required to analyze this.

Thanks.
 
Dear PJRC Community,

I have not received any reply, I understand that I might publish the complete source code, while I am not able to publish it, I have identified a part of the code that seems to make the random resets to happen.

This is an acquisition system, that constantly acquire multiple analog reads, then it send all the data trough USB port. When I try to use the instruction:
"Serial.flush();"

The Teensy 4.0 get randomly stucked, and the only way to make it work again is to restart it.

Is there any possibility that the Serial.flush() has any problem?

Cordially,
 
Is there any possibility that the Serial.flush() has any problem?

Seems unlikely, but not completely ruling out the possibility you may have found a previously unknown bug.

As a quick sanity check, I tried running this on a Teensy 4.0.

Code:
void setup() {
}

void loop() {
  static unsigned int count=0;
  Serial.print("hello world ");
  Serial.flush();
  Serial.println(count++);
  Serial.flush();
  delay(25);
}

Unsurprisingly, Teensy 4.0 isn't rebooting or failing when running this program.

sc.png

Any chance you could trim away all of your sensitive code to create a small sharable program which demonstrates the problem? Or maybe just write a small program from scratch with the same Serial.flush() and whatever other code is needed with it to reproduce the problem?

I can't say what's going wrong, but I can say no more investigation into Serial.flush() is going to be done until we have a program which reproduces the problem.
 
You might also try monitoring the 3.3V power line on your Teensy 4.0.

Perhaps you have other 3.3V circuitry drawing power from your Teensy? Maybe it consumes too much power at a time which happens to coincide with Serial.flush(). If the 3.3V power dips below about 3.0V (a "brown out" condition), the board is supposed to reboot.
 
You might also try monitoring the 3.3V power line on your Teensy 4.0.

Perhaps you have other 3.3V circuitry drawing power from your Teensy? Maybe it consumes too much power at a time which happens to coincide with Serial.flush(). If the 3.3V power dips below about 3.0V (a "brown out" condition), the board is supposed to reboot.

Dear Paul,

I am using the 3.3V output from the Teensy to power other components that are using current, so it seems to explain my issue. I understand that I might improve the power line ciruict.

Anyways, I have been trying to replace the Serial.flush() with a very short delay with delayMicroseconds() and actually this is working properly.

Can you recomend any way to improve the 3.3V output?, or I might use a external LDO for suplying the power for the other components?

Thanks so much for the support.
 
Yes, an external voltage regulator is the way, if you're using too much current on 3.3V. But if all the power is coming from USB, keep in mind the general 5V USB power limit of 500 mA if directly connected to a PC, or 100 mA if connected to an unpowered hub.
 
Status
Not open for further replies.
Back
Top