Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Teensy 4.0 randomly reset by itself

Hybrid View

  1. #1
    Junior Member
    Join Date
    Feb 2017
    Posts
    18

    Teensy 4.0 randomly reset by itself

    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.

  2. #2
    Junior Member
    Join Date
    Feb 2017
    Posts
    18
    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,

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,658
    Quote Originally Posted by ElkinDiaz View Post
    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.

    Click image for larger version. 

Name:	sc.png 
Views:	14 
Size:	35.0 KB 
ID:	20827

    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.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,658
    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.

  5. #5
    Junior Member
    Join Date
    Feb 2017
    Posts
    18
    Quote Originally Posted by PaulStoffregen View Post
    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.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,658
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •