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

Thread: Button, timeout and boot

  1. #1
    Member
    Join Date
    Apr 2018
    Location
    Eastern Time, USA
    Posts
    71

    Button, timeout and boot

    I would like to request a feature or enhancement, for the function of the button on the Teensy.

    After pushing the button, if a connection is not found to an instance of the Teensy Loader (on the host computer) within some timeout (let's say 10 seconds), the Teensy reboots with the program that it is already stored.

    We can add a feature to this, and say if it does not have a program stored already, then it does not timeout. It just continues to wait.

    I believe this would be a big help for those of us who would like to productize something that we built using a Teensy.

    Thank you

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,385
    As one can see in many threads of these forums, there is a general misconception about that button which is erroneously seen as a reset knob. Thus, defaulting to reset/reboot after a timeout sounds like a very good idea!

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,928
    I am considering a change to Teensy Loader, where the window would automatically raise to the front during programming and for the ~1.5 seconds after rebooting, where it should "Reboot OK". Then, if it has not been on the top of other windows, it would try to lower itself back to the same relative level it had been.

    This risks annoying people. Windows that "pop up" can appear to be too aggressive, like web advertising of the late 1990.

    But the plus side might be better awareness than pressing the button is causing the board to be reprogrammed, and the reboot behavior isn't actually from the button but a side effect of the reprogramming. As we have things today, especially with many Windows users on laptops or other machines with small screens, they tend to maximize 1 window and the tiny Teensy Loader window stays unseen during programming & rebooting.

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,385
    I see the problem rather with a Teensy which is deployed within a custom device. Imagine that the end user is not aware of the fact that it's a program button and tries to use it as a reset button. Result is, the Teensy would wait to be re-programmed forever and the client would panic. If - without re-programmation after a timeout - the Teensy would reboot afterwards, the button would have had its new secondary function as a reset knob as expected by the naive end user.

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,566
    The bootloader can ping the host, and if there is no teensyloader that responds within a short time just reset.. for all the cases where the teensyloader is not running or USB not even connected it would be a plus.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,354
    Paul: I like the 'short pop to front' idea - you are correct that TeensyLoader gets buried - even with two large screens - but it is comforting to get confirmation of the upload. I often leave my sound off so I don't get the Chime out/in on the USB detect.

    Finding a way to overload the Program Button to reset would be nice. Though I regularly tap the button to stop the blinking lights - or when I know the code has run adrift and want it to pause and be ready for the next Upload. I need to do that at times when I Fault the MCU - which I do on purpose - and the CPU would otherwise fail the subsequent upload notice from the PC. So simply putting a 'one press with timeout' would run afoul of my current process expectations. Likewise TeensyLoader in AUTO mode doesn't let me do that - so that is another reason I like TyCommander as it takes a button press as a bootloader request without then forcing an upload - until the builder tells it to, or I hit its GUI reset. So perhaps a short [<0.5 sec] then longer press [>1 sec] of Program - [within 1 second of each other?] - might equate to a reset - or maybe a longer press and then a short press. It would take a proper choice to have the Teensy know whether or not to trigger TeensyLoader to Upload [go to Program] or Reset without Upload. If something could work out it would be nice not to have to unplug/repower the Teensy to get a reset - and I'd hope that would be under control of the bootloader MCU.

    To be honest when I started here 4 yrs back it took some time for somebody to actually communicate to me that that was not a reset button. Perhaps because "it seems to do a reset" where TeensyLoader quickly reprograms and restarts the Teensy. Until that one frustrating upload that hangs the MCU, and the reset just uploads the same code to hang once again.

  7. #7
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,002
    how about a double tap to reprogram, single tap for reset, or hold for specific period (2 secs?) for program mode

  8. #8
    Member
    Join Date
    Apr 2018
    Location
    Eastern Time, USA
    Posts
    71
    Defragster raises a separate point, he wants a "halt". He could do that by having a "halt" program ready to load when he pushes the button.

    I feel that "Reset" aligns better with what users expect the button to do, others seem to agree.

    Morerover, "Reset" allows deployment of the teensy into the real world. In a sense, it allows the Teensy to go from "Toy" to "Tool".

    As such, "Reset" would be a huge, huge, benefit for the teensy. I think this is pretty important.

  9. #9
    Member
    Join Date
    Apr 2018
    Location
    Eastern Time, USA
    Posts
    71
    @tonton81 - No, that would not be robust for deployment and you could not use it in a professional context.

    Think of it in terms of sending a board to the space station, or antartica, or a factory floor.

    (An easy way to connect halt to the button as it is now, is to just have a "halt" program ready to be loaded when you push the button).
    Last edited by DrM; 02-19-2019 at 12:41 PM.

  10. #10
    Member
    Join Date
    Apr 2018
    Location
    Eastern Time, USA
    Posts
    71
    @PaulStoffregen

    Hi Paul, is there any chance of this happening?

    If you are too busy for this, if instructions and source available, perhaps one of us could have a go at it.

Posting Permissions

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